mirror of
https://github.com/tc39/test262.git
synced 2025-07-23 22:15:24 +02:00
Use verifyProperty in language/expressions tests
This commit is contained in:
parent
ff81dccfc3
commit
08a7b9d4b6
@ -33,28 +33,36 @@ includes: [propertyHelper.js]
|
||||
|
||||
var f1 = (x = 42) => {};
|
||||
|
||||
assert.sameValue(f1.length, 0, 'FormalsList: x = 42');
|
||||
verifyNotEnumerable(f1, 'length');
|
||||
verifyNotWritable(f1, 'length');
|
||||
verifyConfigurable(f1, 'length');
|
||||
verifyProperty(f1, "length", {
|
||||
value: 0,
|
||||
writable: false,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
||||
|
||||
var f2 = (x = 42, y) => {};
|
||||
|
||||
assert.sameValue(f2.length, 0, 'FormalsList: x = 42, y');
|
||||
verifyNotEnumerable(f2, 'length');
|
||||
verifyNotWritable(f2, 'length');
|
||||
verifyConfigurable(f2, 'length');
|
||||
verifyProperty(f2, "length", {
|
||||
value: 0,
|
||||
writable: false,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
||||
|
||||
var f3 = (x, y = 42) => {};
|
||||
|
||||
assert.sameValue(f3.length, 1, 'FormalsList: x, y = 42');
|
||||
verifyNotEnumerable(f3, 'length');
|
||||
verifyNotWritable(f3, 'length');
|
||||
verifyConfigurable(f3, 'length');
|
||||
verifyProperty(f3, "length", {
|
||||
value: 1,
|
||||
writable: false,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
||||
|
||||
var f4 = (x, y = 42, z) => {};
|
||||
|
||||
assert.sameValue(f4.length, 1, 'FormalsList: x, y = 42, z');
|
||||
verifyNotEnumerable(f4, 'length');
|
||||
verifyNotWritable(f4, 'length');
|
||||
verifyConfigurable(f4, 'length');
|
||||
verifyProperty(f4, "length", {
|
||||
value: 1,
|
||||
writable: false,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
||||
|
@ -25,7 +25,9 @@ var arrow;
|
||||
|
||||
arrow = () => {};
|
||||
|
||||
assert.sameValue(arrow.name, 'arrow');
|
||||
verifyNotEnumerable(arrow, 'name');
|
||||
verifyNotWritable(arrow, 'name');
|
||||
verifyConfigurable(arrow, 'name');
|
||||
verifyProperty(arrow, 'name', {
|
||||
value: 'arrow',
|
||||
writable: false,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
||||
|
@ -31,7 +31,9 @@ xCls2 = class { static name() {} };
|
||||
assert.notSameValue(xCls.name, 'xCls');
|
||||
assert.notSameValue(xCls2.name, 'xCls2');
|
||||
|
||||
assert.sameValue(cls.name, 'cls');
|
||||
verifyNotEnumerable(cls, 'name');
|
||||
verifyNotWritable(cls, 'name');
|
||||
verifyConfigurable(cls, 'name');
|
||||
verifyProperty(cls, 'name', {
|
||||
value: 'cls',
|
||||
writable: false,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
||||
|
@ -29,7 +29,9 @@ cover = (function() {});
|
||||
|
||||
assert(xCover.name !== 'xCover');
|
||||
|
||||
assert.sameValue(cover.name, 'cover');
|
||||
verifyNotEnumerable(cover, 'name');
|
||||
verifyNotWritable(cover, 'name');
|
||||
verifyConfigurable(cover, 'name');
|
||||
verifyProperty(cover, 'name', {
|
||||
value: 'cover',
|
||||
writable: false,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
||||
|
@ -28,7 +28,9 @@ fn = function() {};
|
||||
|
||||
assert(xFn.name !== 'xFn');
|
||||
|
||||
assert.sameValue(fn.name, 'fn');
|
||||
verifyNotEnumerable(fn, 'name');
|
||||
verifyNotWritable(fn, 'name');
|
||||
verifyConfigurable(fn, 'name');
|
||||
verifyProperty(fn, 'name', {
|
||||
value: 'fn',
|
||||
writable: false,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
||||
|
@ -29,7 +29,9 @@ gen = function*() {};
|
||||
|
||||
assert(xGen.name !== 'xGen');
|
||||
|
||||
assert.sameValue(gen.name, 'gen');
|
||||
verifyNotEnumerable(gen, 'name');
|
||||
verifyNotWritable(gen, 'name');
|
||||
verifyConfigurable(gen, 'name');
|
||||
verifyProperty(gen, 'name', {
|
||||
value: 'gen',
|
||||
writable: false,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
||||
|
@ -32,28 +32,36 @@ includes: [propertyHelper.js]
|
||||
|
||||
var m1 = class { *m(x = 42) {} }.prototype.m;
|
||||
|
||||
assert.sameValue(m1.length, 0, 'formalslist: x = 42');
|
||||
verifyNotEnumerable(m1, 'length');
|
||||
verifyNotWritable(m1, 'length');
|
||||
verifyConfigurable(m1, 'length');
|
||||
verifyProperty(m1, "length", {
|
||||
value: 0,
|
||||
writable: false,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
||||
|
||||
var m2 = class { *m(x = 42, y) {} }.prototype.m;
|
||||
|
||||
assert.sameValue(m2.length, 0, 'formalslist: x = 42, y');
|
||||
verifyNotEnumerable(m2, 'length');
|
||||
verifyNotWritable(m2, 'length');
|
||||
verifyConfigurable(m2, 'length');
|
||||
verifyProperty(m2, "length", {
|
||||
value: 0,
|
||||
writable: false,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
||||
|
||||
var m3 = class { *m(x, y = 42) {} }.prototype.m;
|
||||
|
||||
assert.sameValue(m3.length, 1, 'formalslist: x, y = 42');
|
||||
verifyNotEnumerable(m3, 'length');
|
||||
verifyNotWritable(m3, 'length');
|
||||
verifyConfigurable(m3, 'length');
|
||||
verifyProperty(m3, "length", {
|
||||
value: 1,
|
||||
writable: false,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
||||
|
||||
var m4 = class { *m(x, y = 42, z) {} }.prototype.m;
|
||||
|
||||
assert.sameValue(m4.length, 1, 'formalslist: x, y = 42, z');
|
||||
verifyNotEnumerable(m4, 'length');
|
||||
verifyNotWritable(m4, 'length');
|
||||
verifyConfigurable(m4, 'length');
|
||||
verifyProperty(m4, "length", {
|
||||
value: 1,
|
||||
writable: false,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
||||
|
@ -32,28 +32,36 @@ includes: [propertyHelper.js]
|
||||
|
||||
var m1 = class { m(x = 42) {} }.prototype.m;
|
||||
|
||||
assert.sameValue(m1.length, 0, 'formalslist: x = 42');
|
||||
verifyNotEnumerable(m1, 'length');
|
||||
verifyNotWritable(m1, 'length');
|
||||
verifyConfigurable(m1, 'length');
|
||||
verifyProperty(m1, "length", {
|
||||
value: 0,
|
||||
writable: false,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
||||
|
||||
var m2 = class { m(x = 42, y) {} }.prototype.m;
|
||||
|
||||
assert.sameValue(m2.length, 0, 'formalslist: x = 42, y');
|
||||
verifyNotEnumerable(m2, 'length');
|
||||
verifyNotWritable(m2, 'length');
|
||||
verifyConfigurable(m2, 'length');
|
||||
verifyProperty(m2, "length", {
|
||||
value: 0,
|
||||
writable: false,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
||||
|
||||
var m3 = class { m(x, y = 42) {} }.prototype.m;
|
||||
|
||||
assert.sameValue(m3.length, 1, 'formalslist: x, y = 42');
|
||||
verifyNotEnumerable(m3, 'length');
|
||||
verifyNotWritable(m3, 'length');
|
||||
verifyConfigurable(m3, 'length');
|
||||
verifyProperty(m3, "length", {
|
||||
value: 1,
|
||||
writable: false,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
||||
|
||||
var m4 = class { m(x, y = 42, z) {} }.prototype.m;
|
||||
|
||||
assert.sameValue(m4.length, 1, 'formalslist: x, y = 42, z');
|
||||
verifyNotEnumerable(m4, 'length');
|
||||
verifyNotWritable(m4, 'length');
|
||||
verifyConfigurable(m4, 'length');
|
||||
verifyProperty(m4, "length", {
|
||||
value: 1,
|
||||
writable: false,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
||||
|
@ -33,7 +33,9 @@ includes: [propertyHelper.js]
|
||||
var C = class { set m(x = 42) {} };
|
||||
var set = Object.getOwnPropertyDescriptor(C.prototype, 'm').set;
|
||||
|
||||
assert.sameValue(set.length, 0, 'FormalsList: x = 42');
|
||||
verifyNotEnumerable(set, 'length');
|
||||
verifyNotWritable(set, 'length');
|
||||
verifyConfigurable(set, 'length');
|
||||
verifyProperty(set, 'length', {
|
||||
value: 0,
|
||||
writable: false,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
||||
|
@ -32,28 +32,36 @@ includes: [propertyHelper.js]
|
||||
|
||||
var m1 = class { static m(x = 42) {} }.m;
|
||||
|
||||
assert.sameValue(m1.length, 0, 'formalslist: x = 42');
|
||||
verifyNotEnumerable(m1, 'length');
|
||||
verifyNotWritable(m1, 'length');
|
||||
verifyConfigurable(m1, 'length');
|
||||
verifyProperty(m1, "length", {
|
||||
value: 0,
|
||||
writable: false,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
||||
|
||||
var m2 = class { static m(x = 42, y) {} }.m;
|
||||
|
||||
assert.sameValue(m2.length, 0, 'formalslist: x = 42, y');
|
||||
verifyNotEnumerable(m2, 'length');
|
||||
verifyNotWritable(m2, 'length');
|
||||
verifyConfigurable(m2, 'length');
|
||||
verifyProperty(m2, "length", {
|
||||
value: 0,
|
||||
writable: false,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
||||
|
||||
var m3 = class { static m(x, y = 42) {} }.m;
|
||||
|
||||
assert.sameValue(m3.length, 1, 'formalslist: x, y = 42');
|
||||
verifyNotEnumerable(m3, 'length');
|
||||
verifyNotWritable(m3, 'length');
|
||||
verifyConfigurable(m3, 'length');
|
||||
verifyProperty(m3, "length", {
|
||||
value: 1,
|
||||
writable: false,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
||||
|
||||
var m4 = class { static m(x, y = 42, z) {} }.m;
|
||||
|
||||
assert.sameValue(m4.length, 1, 'formalslist: x, y = 42, z');
|
||||
verifyNotEnumerable(m4, 'length');
|
||||
verifyNotWritable(m4, 'length');
|
||||
verifyConfigurable(m4, 'length');
|
||||
verifyProperty(m4, "length", {
|
||||
value: 1,
|
||||
writable: false,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
||||
|
@ -33,28 +33,36 @@ includes: [propertyHelper.js]
|
||||
|
||||
var f1 = function (x = 42) {};
|
||||
|
||||
assert.sameValue(f1.length, 0, 'FormalsList: x = 42');
|
||||
verifyNotEnumerable(f1, 'length');
|
||||
verifyNotWritable(f1, 'length');
|
||||
verifyConfigurable(f1, 'length');
|
||||
verifyProperty(f1, "length", {
|
||||
value: 0,
|
||||
writable: false,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
||||
|
||||
var f2 = function (x = 42, y) {};
|
||||
|
||||
assert.sameValue(f2.length, 0, 'FormalsList: x = 42, y');
|
||||
verifyNotEnumerable(f2, 'length');
|
||||
verifyNotWritable(f2, 'length');
|
||||
verifyConfigurable(f2, 'length');
|
||||
verifyProperty(f2, "length", {
|
||||
value: 0,
|
||||
writable: false,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
||||
|
||||
var f3 = function (x, y = 42) {};
|
||||
|
||||
assert.sameValue(f3.length, 1, 'FormalsList: x, y = 42');
|
||||
verifyNotEnumerable(f3, 'length');
|
||||
verifyNotWritable(f3, 'length');
|
||||
verifyConfigurable(f3, 'length');
|
||||
verifyProperty(f3, "length", {
|
||||
value: 1,
|
||||
writable: false,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
||||
|
||||
var f4 = function (x, y = 42, z) {};
|
||||
|
||||
assert.sameValue(f4.length, 1, 'FormalsList: x, y = 42, z');
|
||||
verifyNotEnumerable(f4, 'length');
|
||||
verifyNotWritable(f4, 'length');
|
||||
verifyConfigurable(f4, 'length');
|
||||
verifyProperty(f4, "length", {
|
||||
value: 1,
|
||||
writable: false,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
||||
|
@ -33,28 +33,36 @@ includes: [propertyHelper.js]
|
||||
|
||||
var f1 = function* (x = 42) {};
|
||||
|
||||
assert.sameValue(f1.length, 0, 'FormalsList: x = 42');
|
||||
verifyNotEnumerable(f1, 'length');
|
||||
verifyNotWritable(f1, 'length');
|
||||
verifyConfigurable(f1, 'length');
|
||||
verifyProperty(f1, "length", {
|
||||
value: 0,
|
||||
writable: false,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
||||
|
||||
var f2 = function* (x = 42, y) {};
|
||||
|
||||
assert.sameValue(f2.length, 0, 'FormalsList: x = 42, y');
|
||||
verifyNotEnumerable(f2, 'length');
|
||||
verifyNotWritable(f2, 'length');
|
||||
verifyConfigurable(f2, 'length');
|
||||
verifyProperty(f2, "length", {
|
||||
value: 0,
|
||||
writable: false,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
||||
|
||||
var f3 = function* (x, y = 42) {};
|
||||
|
||||
assert.sameValue(f3.length, 1, 'FormalsList: x, y = 42');
|
||||
verifyNotEnumerable(f3, 'length');
|
||||
verifyNotWritable(f3, 'length');
|
||||
verifyConfigurable(f3, 'length');
|
||||
verifyProperty(f3, "length", {
|
||||
value: 1,
|
||||
writable: false,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
||||
|
||||
var f4 = function* (x, y = 42, z) {};
|
||||
|
||||
assert.sameValue(f4.length, 1, 'FormalsList: x, y = 42, z');
|
||||
verifyNotEnumerable(f4, 'length');
|
||||
verifyNotWritable(f4, 'length');
|
||||
verifyConfigurable(f4, 'length');
|
||||
verifyProperty(f4, "length", {
|
||||
value: 1,
|
||||
writable: false,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
||||
|
@ -11,7 +11,9 @@ features: [generators]
|
||||
|
||||
var g = function*() {};
|
||||
|
||||
assert.sameValue(g.length, 0);
|
||||
verifyNotEnumerable(g, 'length');
|
||||
verifyNotWritable(g, 'length');
|
||||
verifyConfigurable(g, 'length');
|
||||
verifyProperty(g, "length", {
|
||||
value: 0,
|
||||
writable: false,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
||||
|
@ -11,6 +11,8 @@ features: [generators]
|
||||
|
||||
var g = function*() {};
|
||||
|
||||
verifyNotEnumerable(g, 'prototype');
|
||||
verifyWritable(g, 'prototype');
|
||||
verifyNotConfigurable(g, 'prototype');
|
||||
verifyProperty(g, "prototype", {
|
||||
writable: true,
|
||||
enumerable: false,
|
||||
configurable: false,
|
||||
});
|
||||
|
@ -24,19 +24,25 @@ o = {
|
||||
};
|
||||
|
||||
getter = Object.getOwnPropertyDescriptor(o, 'id').get;
|
||||
assert.sameValue(getter.name, 'get id');
|
||||
verifyNotEnumerable(getter, 'name');
|
||||
verifyNotWritable(getter, 'name');
|
||||
verifyConfigurable(getter, 'name');
|
||||
verifyProperty(getter, 'name', {
|
||||
value: 'get id',
|
||||
writable: false,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
||||
|
||||
getter = Object.getOwnPropertyDescriptor(o, anonSym).get;
|
||||
assert.sameValue(getter.name, 'get ');
|
||||
verifyNotEnumerable(getter, 'name');
|
||||
verifyNotWritable(getter, 'name');
|
||||
verifyConfigurable(getter, 'name');
|
||||
verifyProperty(getter, 'name', {
|
||||
value: 'get ',
|
||||
writable: false,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
||||
|
||||
getter = Object.getOwnPropertyDescriptor(o, namedSym).get;
|
||||
assert.sameValue(getter.name, 'get [test262]');
|
||||
verifyNotEnumerable(getter, 'name');
|
||||
verifyNotWritable(getter, 'name');
|
||||
verifyConfigurable(getter, 'name');
|
||||
verifyProperty(getter, 'name', {
|
||||
value: 'get [test262]',
|
||||
writable: false,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
||||
|
@ -25,19 +25,25 @@ o = {
|
||||
};
|
||||
|
||||
setter = Object.getOwnPropertyDescriptor(o, 'id').set;
|
||||
assert.sameValue(setter.name, 'set id');
|
||||
verifyNotEnumerable(setter, 'name');
|
||||
verifyNotWritable(setter, 'name');
|
||||
verifyConfigurable(setter, 'name');
|
||||
verifyProperty(setter, 'name', {
|
||||
value: 'set id',
|
||||
writable: false,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
||||
|
||||
setter = Object.getOwnPropertyDescriptor(o, anonSym).set;
|
||||
assert.sameValue(setter.name, 'set ');
|
||||
verifyNotEnumerable(setter, 'name');
|
||||
verifyNotWritable(setter, 'name');
|
||||
verifyConfigurable(setter, 'name');
|
||||
verifyProperty(setter, 'name', {
|
||||
value: 'set ',
|
||||
writable: false,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
||||
|
||||
setter = Object.getOwnPropertyDescriptor(o, namedSym).set;
|
||||
assert.sameValue(setter.name, 'set [test262]');
|
||||
verifyNotEnumerable(setter, 'name');
|
||||
verifyNotWritable(setter, 'name');
|
||||
verifyConfigurable(setter, 'name');
|
||||
verifyProperty(setter, 'name', {
|
||||
value: 'set [test262]',
|
||||
writable: false,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
||||
|
@ -24,17 +24,23 @@ o = {
|
||||
[namedSym]: () => {}
|
||||
};
|
||||
|
||||
assert.sameValue(o.id.name, 'id', 'via IdentifierName');
|
||||
verifyNotEnumerable(o.id, 'name');
|
||||
verifyNotWritable(o.id, 'name');
|
||||
verifyConfigurable(o.id, 'name');
|
||||
verifyProperty(o.id, 'name', {
|
||||
value: 'id',
|
||||
writable: false,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
||||
|
||||
assert.sameValue(o[anonSym].name, '', 'via anonymous Symbol');
|
||||
verifyNotEnumerable(o[anonSym], 'name');
|
||||
verifyNotWritable(o[anonSym], 'name');
|
||||
verifyConfigurable(o[anonSym], 'name');
|
||||
verifyProperty(o[anonSym], 'name', {
|
||||
value: '',
|
||||
writable: false,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
||||
|
||||
assert.sameValue(o[namedSym].name, '[test262]', 'via Symbol');
|
||||
verifyNotEnumerable(o[namedSym], 'name');
|
||||
verifyNotWritable(o[namedSym], 'name');
|
||||
verifyConfigurable(o[namedSym], 'name');
|
||||
verifyProperty(o[namedSym], 'name', {
|
||||
value: '[test262]',
|
||||
writable: false,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
||||
|
@ -27,17 +27,23 @@ o = {
|
||||
|
||||
assert(o.xId.name !== 'xId');
|
||||
|
||||
assert.sameValue(o.id.name, 'id', 'via IdentifierName');
|
||||
verifyNotEnumerable(o.id, 'name');
|
||||
verifyNotWritable(o.id, 'name');
|
||||
verifyConfigurable(o.id, 'name');
|
||||
verifyProperty(o.id, 'name', {
|
||||
value: 'id',
|
||||
writable: false,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
||||
|
||||
assert.sameValue(o[anonSym].name, '', 'via anonymous Symbol');
|
||||
verifyNotEnumerable(o[anonSym], 'name');
|
||||
verifyNotWritable(o[anonSym], 'name');
|
||||
verifyConfigurable(o[anonSym], 'name');
|
||||
verifyProperty(o[anonSym], 'name', {
|
||||
value: '',
|
||||
writable: false,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
||||
|
||||
assert.sameValue(o[namedSym].name, '[test262]', 'via Symbol');
|
||||
verifyNotEnumerable(o[namedSym], 'name');
|
||||
verifyNotWritable(o[namedSym], 'name');
|
||||
verifyConfigurable(o[namedSym], 'name');
|
||||
verifyProperty(o[namedSym], 'name', {
|
||||
value: '[test262]',
|
||||
writable: false,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
||||
|
@ -28,17 +28,23 @@ o = {
|
||||
|
||||
assert(o.xId.name !== 'xId');
|
||||
|
||||
assert.sameValue(o.id.name, 'id', 'via IdentifierName');
|
||||
verifyNotEnumerable(o.id, 'name');
|
||||
verifyNotWritable(o.id, 'name');
|
||||
verifyConfigurable(o.id, 'name');
|
||||
verifyProperty(o.id, 'name', {
|
||||
value: 'id',
|
||||
writable: false,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
||||
|
||||
assert.sameValue(o[anonSym].name, '', 'via anonymous Symbol');
|
||||
verifyNotEnumerable(o[anonSym], 'name');
|
||||
verifyNotWritable(o[anonSym], 'name');
|
||||
verifyConfigurable(o[anonSym], 'name');
|
||||
verifyProperty(o[anonSym], 'name', {
|
||||
value: '',
|
||||
writable: false,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
||||
|
||||
assert.sameValue(o[namedSym].name, '[test262]', 'via Symbol');
|
||||
verifyNotEnumerable(o[namedSym], 'name');
|
||||
verifyNotWritable(o[namedSym], 'name');
|
||||
verifyConfigurable(o[namedSym], 'name');
|
||||
verifyProperty(o[namedSym], 'name', {
|
||||
value: '[test262]',
|
||||
writable: false,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
||||
|
@ -27,17 +27,23 @@ o = {
|
||||
|
||||
assert(o.xId.name !== 'xId');
|
||||
|
||||
assert.sameValue(o.id.name, 'id', 'via IdentifierName');
|
||||
verifyNotEnumerable(o.id, 'name');
|
||||
verifyNotWritable(o.id, 'name');
|
||||
verifyConfigurable(o.id, 'name');
|
||||
verifyProperty(o.id, 'name', {
|
||||
value: 'id',
|
||||
writable: false,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
||||
|
||||
assert.sameValue(o[anonSym].name, '', 'via anonymous Symbol');
|
||||
verifyNotEnumerable(o[anonSym], 'name');
|
||||
verifyNotWritable(o[anonSym], 'name');
|
||||
verifyConfigurable(o[anonSym], 'name');
|
||||
verifyProperty(o[anonSym], 'name', {
|
||||
value: '',
|
||||
writable: false,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
||||
|
||||
assert.sameValue(o[namedSym].name, '[test262]', 'via Symbol');
|
||||
verifyNotEnumerable(o[namedSym], 'name');
|
||||
verifyNotWritable(o[namedSym], 'name');
|
||||
verifyConfigurable(o[namedSym], 'name');
|
||||
verifyProperty(o[namedSym], 'name', {
|
||||
value: '[test262]',
|
||||
writable: false,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
||||
|
@ -28,17 +28,23 @@ o = {
|
||||
|
||||
assert(o.xId.name !== 'xId');
|
||||
|
||||
assert.sameValue(o.id.name, 'id', 'via IdentifierName');
|
||||
verifyNotEnumerable(o.id, 'name');
|
||||
verifyNotWritable(o.id, 'name');
|
||||
verifyConfigurable(o.id, 'name');
|
||||
verifyProperty(o.id, 'name', {
|
||||
value: 'id',
|
||||
writable: false,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
||||
|
||||
assert.sameValue(o[anonSym].name, '', 'via anonymous Symbol');
|
||||
verifyNotEnumerable(o[anonSym], 'name');
|
||||
verifyNotWritable(o[anonSym], 'name');
|
||||
verifyConfigurable(o[anonSym], 'name');
|
||||
verifyProperty(o[anonSym], 'name', {
|
||||
value: '',
|
||||
writable: false,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
||||
|
||||
assert.sameValue(o[namedSym].name, '[test262]', 'via Symbol');
|
||||
verifyNotEnumerable(o[namedSym], 'name');
|
||||
verifyNotWritable(o[namedSym], 'name');
|
||||
verifyConfigurable(o[namedSym], 'name');
|
||||
verifyProperty(o[namedSym], 'name', {
|
||||
value: '[test262]',
|
||||
writable: false,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
||||
|
@ -29,8 +29,11 @@ includes: [propertyHelper.js]
|
||||
var obj = { get m() { return 1234; } };
|
||||
var desc = Object.getOwnPropertyDescriptor(obj, 'm');
|
||||
|
||||
verifyEnumerable(obj, 'm');
|
||||
verifyConfigurable(obj, 'm');
|
||||
verifyProperty(obj, 'm', {
|
||||
enumerable: true,
|
||||
configurable: true,
|
||||
});
|
||||
|
||||
assert.sameValue(desc.value, undefined, '`value` field');
|
||||
assert.sameValue(desc.set, undefined, '`set` field');
|
||||
assert.sameValue(typeof desc.get, 'function', 'type of `get` field');
|
||||
|
@ -24,17 +24,23 @@ o = {
|
||||
[namedSym]() {}
|
||||
};
|
||||
|
||||
assert.sameValue(o.id.name, 'id', 'via IdentifierName');
|
||||
verifyNotEnumerable(o.id, 'name');
|
||||
verifyNotWritable(o.id, 'name');
|
||||
verifyConfigurable(o.id, 'name');
|
||||
verifyProperty(o.id, 'name', {
|
||||
value: 'id',
|
||||
writable: false,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
||||
|
||||
assert.sameValue(o[anonSym].name, '', 'via anonymous Symbol');
|
||||
verifyNotEnumerable(o[anonSym], 'name');
|
||||
verifyNotWritable(o[anonSym], 'name');
|
||||
verifyConfigurable(o[anonSym], 'name');
|
||||
verifyProperty(o[anonSym], 'name', {
|
||||
value: '',
|
||||
writable: false,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
||||
|
||||
assert.sameValue(o[namedSym].name, '[test262]', 'via Symbol');
|
||||
verifyNotEnumerable(o[namedSym], 'name');
|
||||
verifyNotWritable(o[namedSym], 'name');
|
||||
verifyConfigurable(o[namedSym], 'name');
|
||||
verifyProperty(o[namedSym], 'name', {
|
||||
value: '[test262]',
|
||||
writable: false,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
||||
|
@ -25,17 +25,23 @@ o = {
|
||||
*[namedSym]() {}
|
||||
};
|
||||
|
||||
assert.sameValue(o.id.name, 'id', 'via IdentifierName');
|
||||
verifyNotEnumerable(o.id, 'name');
|
||||
verifyNotWritable(o.id, 'name');
|
||||
verifyConfigurable(o.id, 'name');
|
||||
verifyProperty(o.id, 'name', {
|
||||
value: 'id',
|
||||
writable: false,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
||||
|
||||
assert.sameValue(o[anonSym].name, '', 'via anonymous Symbol');
|
||||
verifyNotEnumerable(o[anonSym], 'name');
|
||||
verifyNotWritable(o[anonSym], 'name');
|
||||
verifyConfigurable(o[anonSym], 'name');
|
||||
verifyProperty(o[anonSym], 'name', {
|
||||
value: '',
|
||||
writable: false,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
||||
|
||||
assert.sameValue(o[namedSym].name, '[test262]', 'via Symbol');
|
||||
verifyNotEnumerable(o[namedSym], 'name');
|
||||
verifyNotWritable(o[namedSym], 'name');
|
||||
verifyConfigurable(o[namedSym], 'name');
|
||||
verifyProperty(o[namedSym], 'name', {
|
||||
value: '[test262]',
|
||||
writable: false,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
||||
|
@ -33,28 +33,36 @@ includes: [propertyHelper.js]
|
||||
|
||||
var f1 = { *m(x = 42) {} }.m;
|
||||
|
||||
assert.sameValue(f1.length, 0, 'FormalsList: x = 42');
|
||||
verifyNotEnumerable(f1, 'length');
|
||||
verifyNotWritable(f1, 'length');
|
||||
verifyConfigurable(f1, 'length');
|
||||
verifyProperty(f1, "length", {
|
||||
value: 0,
|
||||
writable: false,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
||||
|
||||
var f2 = { *m(x = 42, y) {} }.m;
|
||||
|
||||
assert.sameValue(f2.length, 0, 'FormalsList: x = 42, y');
|
||||
verifyNotEnumerable(f2, 'length');
|
||||
verifyNotWritable(f2, 'length');
|
||||
verifyConfigurable(f2, 'length');
|
||||
verifyProperty(f2, "length", {
|
||||
value: 0,
|
||||
writable: false,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
||||
|
||||
var f3 = { *m(x, y = 42) {} }.m;
|
||||
|
||||
assert.sameValue(f3.length, 1, 'FormalsList: x, y = 42');
|
||||
verifyNotEnumerable(f3, 'length');
|
||||
verifyNotWritable(f3, 'length');
|
||||
verifyConfigurable(f3, 'length');
|
||||
verifyProperty(f3, "length", {
|
||||
value: 1,
|
||||
writable: false,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
||||
|
||||
var f4 = { *m(x, y = 42, z) {} }.m;
|
||||
|
||||
assert.sameValue(f4.length, 1, 'FormalsList: x, y = 42, z');
|
||||
verifyNotEnumerable(f4, 'length');
|
||||
verifyNotWritable(f4, 'length');
|
||||
verifyConfigurable(f4, 'length')
|
||||
verifyProperty(f4, "length", {
|
||||
value: 1,
|
||||
writable: false,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
||||
|
@ -12,7 +12,9 @@ features: [generators]
|
||||
|
||||
var method = { *method(a, b, c) {} }.method;
|
||||
|
||||
assert.sameValue(method.length, 3);
|
||||
verifyNotEnumerable(method, 'length');
|
||||
verifyNotWritable(method, 'length');
|
||||
verifyConfigurable(method, 'length');
|
||||
verifyProperty(method, "length", {
|
||||
value: 3,
|
||||
writable: false,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
||||
|
@ -12,7 +12,9 @@ features: [generators]
|
||||
|
||||
var method = { *method() {} }.method;
|
||||
|
||||
assert.sameValue(method.name, 'method');
|
||||
verifyNotEnumerable(method, 'name');
|
||||
verifyNotWritable(method, 'name');
|
||||
verifyConfigurable(method, 'name');
|
||||
verifyProperty(method, 'name', {
|
||||
value: 'method',
|
||||
writable: false,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
||||
|
@ -13,7 +13,9 @@ features: [Symbol, generators]
|
||||
var m = Symbol('method');
|
||||
var method = { *[m]() {} }[m];
|
||||
|
||||
assert.sameValue(method.name, '[method]');
|
||||
verifyNotEnumerable(method, 'name');
|
||||
verifyNotWritable(method, 'name');
|
||||
verifyConfigurable(method, 'name');
|
||||
verifyProperty(method, 'name', {
|
||||
value: '[method]',
|
||||
writable: false,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
||||
|
@ -12,6 +12,8 @@ features: [generators]
|
||||
|
||||
var obj = { *method() {} };
|
||||
|
||||
verifyEnumerable(obj, 'method');
|
||||
verifyWritable(obj, 'method');
|
||||
verifyConfigurable(obj, 'method');
|
||||
verifyProperty(obj, "method", {
|
||||
writable: true,
|
||||
enumerable: true,
|
||||
configurable: true,
|
||||
});
|
||||
|
@ -12,11 +12,13 @@ features: [generators]
|
||||
var GeneratorPrototype = Object.getPrototypeOf(function* () {}).prototype;
|
||||
var method = { *method() {} }.method;
|
||||
|
||||
verifyNotEnumerable(method, 'prototype');
|
||||
verifyWritable(method, 'prototype');
|
||||
verifyNotConfigurable(method, 'prototype');
|
||||
|
||||
assert.sameValue(
|
||||
Object.getPrototypeOf(method.prototype),
|
||||
GeneratorPrototype
|
||||
);
|
||||
|
||||
verifyProperty(method, "prototype", {
|
||||
writable: true,
|
||||
enumerable: false,
|
||||
configurable: false,
|
||||
});
|
||||
|
@ -33,28 +33,36 @@ includes: [propertyHelper.js]
|
||||
|
||||
var f1 = { m(x = 42) {} }.m;
|
||||
|
||||
assert.sameValue(f1.length, 0, 'FormalsList: x = 42');
|
||||
verifyNotEnumerable(f1, 'length');
|
||||
verifyNotWritable(f1, 'length');
|
||||
verifyConfigurable(f1, 'length');
|
||||
verifyProperty(f1, "length", {
|
||||
value: 0,
|
||||
writable: false,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
||||
|
||||
var f2 = { m(x = 42, y) {} }.m;
|
||||
|
||||
assert.sameValue(f2.length, 0, 'FormalsList: x = 42, y');
|
||||
verifyNotEnumerable(f2, 'length');
|
||||
verifyNotWritable(f2, 'length');
|
||||
verifyConfigurable(f2, 'length');
|
||||
verifyProperty(f2, "length", {
|
||||
value: 0,
|
||||
writable: false,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
||||
|
||||
var f3 = { m(x, y = 42) {} }.m;
|
||||
|
||||
assert.sameValue(f3.length, 1, 'FormalsList: x, y = 42');
|
||||
verifyNotEnumerable(f3, 'length');
|
||||
verifyNotWritable(f3, 'length');
|
||||
verifyConfigurable(f3, 'length');
|
||||
verifyProperty(f3, "length", {
|
||||
value: 1,
|
||||
writable: false,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
||||
|
||||
var f4 = { m(x, y = 42, z) {} }.m;
|
||||
|
||||
assert.sameValue(f4.length, 1, 'FormalsList: x, y = 42, z');
|
||||
verifyNotEnumerable(f4, 'length');
|
||||
verifyNotWritable(f4, 'length');
|
||||
verifyConfigurable(f4, 'length');
|
||||
verifyProperty(f4, "length", {
|
||||
value: 1,
|
||||
writable: false,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
||||
|
@ -11,7 +11,9 @@ includes: [propertyHelper.js]
|
||||
|
||||
var method = { method(a, b, c) {} }.method;
|
||||
|
||||
assert.sameValue(method.length, 3);
|
||||
verifyNotEnumerable(method, 'length');
|
||||
verifyNotWritable(method, 'length');
|
||||
verifyConfigurable(method, 'length');
|
||||
verifyProperty(method, "length", {
|
||||
value: 3,
|
||||
writable: false,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
||||
|
@ -11,7 +11,9 @@ includes: [propertyHelper.js]
|
||||
|
||||
var method = { method() {} }.method;
|
||||
|
||||
assert.sameValue(method.name, 'method');
|
||||
verifyNotEnumerable(method, 'name');
|
||||
verifyNotWritable(method, 'name');
|
||||
verifyConfigurable(method, 'name');
|
||||
verifyProperty(method, 'name', {
|
||||
value: 'method',
|
||||
writable: false,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
||||
|
@ -13,7 +13,9 @@ features: [Symbol]
|
||||
var m = Symbol('method');
|
||||
var method = { [m]() {} }[m];
|
||||
|
||||
assert.sameValue(method.name, '[method]');
|
||||
verifyNotEnumerable(method, 'name');
|
||||
verifyNotWritable(method, 'name');
|
||||
verifyConfigurable(method, 'name');
|
||||
verifyProperty(method, 'name', {
|
||||
value: '[method]',
|
||||
writable: false,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
||||
|
@ -11,6 +11,8 @@ includes: [propertyHelper.js]
|
||||
|
||||
var obj = { method() {} };
|
||||
|
||||
verifyEnumerable(obj, 'method');
|
||||
verifyWritable(obj, 'method');
|
||||
verifyConfigurable(obj, 'method');
|
||||
verifyProperty(obj, "method", {
|
||||
writable: true,
|
||||
enumerable: true,
|
||||
configurable: true,
|
||||
});
|
||||
|
@ -15,7 +15,9 @@ var obj;
|
||||
|
||||
obj = { attr };
|
||||
|
||||
assert.sameValue(obj.attr, 23);
|
||||
verifyEnumerable(obj, 'attr');
|
||||
verifyWritable(obj, 'attr');
|
||||
verifyConfigurable(obj, 'attr');
|
||||
verifyProperty(obj, "attr", {
|
||||
value: 23,
|
||||
writable: true,
|
||||
enumerable: true,
|
||||
configurable: true,
|
||||
});
|
||||
|
@ -33,7 +33,9 @@ includes: [propertyHelper.js]
|
||||
|
||||
var set = Object.getOwnPropertyDescriptor({ set m(x = 42) {} }, 'm').set;
|
||||
|
||||
assert.sameValue(set.length, 0, 'FormalsList: x = 42');
|
||||
verifyNotEnumerable(set, 'length');
|
||||
verifyNotWritable(set, 'length');
|
||||
verifyConfigurable(set, 'length');
|
||||
verifyProperty(set, 'length', {
|
||||
value: 0,
|
||||
writable: false,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
||||
|
@ -29,8 +29,11 @@ includes: [propertyHelper.js]
|
||||
var obj = { set m(x) { return x; } };
|
||||
var desc = Object.getOwnPropertyDescriptor(obj, 'm');
|
||||
|
||||
verifyEnumerable(obj, 'm');
|
||||
verifyConfigurable(obj, 'm');
|
||||
verifyProperty(obj, 'm', {
|
||||
enumerable: true,
|
||||
configurable: true,
|
||||
});
|
||||
|
||||
assert.sameValue(desc.value, undefined, '`value` field');
|
||||
assert.sameValue(desc.get, undefined, '`get` field');
|
||||
assert.sameValue(typeof desc.set, 'function', 'type of `set` field');
|
||||
|
Loading…
x
Reference in New Issue
Block a user