mirror of https://github.com/tc39/test262.git
Generate tests
This commit is contained in:
parent
d4fc8d6fc9
commit
96809308fd
|
@ -0,0 +1,60 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-fields/literal-names-asi.case
|
||||
// - src/class-fields/productions/cls-expr-after-same-line-gen.template
|
||||
/*---
|
||||
description: Literal property names with ASI (field definitions after a generator in the same line)
|
||||
esid: prod-FieldDefinition
|
||||
features: [generators, class, class-fields-public]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
ClassElement:
|
||||
...
|
||||
FieldDefinition ;
|
||||
|
||||
FieldDefinition:
|
||||
ClassElementName Initializer_opt
|
||||
|
||||
ClassElementName:
|
||||
PropertyName
|
||||
|
||||
---*/
|
||||
|
||||
|
||||
var C = class {
|
||||
*m() { return 42; } a
|
||||
b = 42;;
|
||||
|
||||
}
|
||||
|
||||
var c = new C();
|
||||
|
||||
assert.sameValue(c.m().next().value, 42);
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "m"), false);
|
||||
assert.sameValue(c.m, C.prototype.m);
|
||||
|
||||
verifyProperty(C.prototype, "m", {
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
writable: true,
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "a"), false);
|
||||
|
||||
verifyProperty(c, "a", {
|
||||
value: undefined,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "b"), false);
|
||||
|
||||
verifyProperty(c, "b", {
|
||||
value: 42,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
|
@ -0,0 +1,60 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-fields/literal-names-asi.case
|
||||
// - src/class-fields/productions/cls-expr-after-same-line-method.template
|
||||
/*---
|
||||
description: Literal property names with ASI (field definitions after a method in the same line)
|
||||
esid: prod-FieldDefinition
|
||||
features: [class, class-fields-public]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
ClassElement:
|
||||
...
|
||||
FieldDefinition ;
|
||||
|
||||
FieldDefinition:
|
||||
ClassElementName Initializer_opt
|
||||
|
||||
ClassElementName:
|
||||
PropertyName
|
||||
|
||||
---*/
|
||||
|
||||
|
||||
var C = class {
|
||||
m() { return 42; } a
|
||||
b = 42;;
|
||||
|
||||
}
|
||||
|
||||
var c = new C();
|
||||
|
||||
assert.sameValue(c.m(), 42);
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "m"), false);
|
||||
assert.sameValue(c.m, C.prototype.m);
|
||||
|
||||
verifyProperty(C.prototype, "m", {
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
writable: true,
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "a"), false);
|
||||
|
||||
verifyProperty(c, "a", {
|
||||
value: undefined,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "b"), false);
|
||||
|
||||
verifyProperty(c, "b", {
|
||||
value: 42,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
|
@ -0,0 +1,74 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-fields/literal-names-asi.case
|
||||
// - src/class-fields/productions/cls-expr-after-same-line-static-async-gen.template
|
||||
/*---
|
||||
description: Literal property names with ASI (field definitions after a static async generator in the same line)
|
||||
esid: prod-FieldDefinition
|
||||
features: [class, class-fields-public, async-iteration]
|
||||
flags: [generated, async]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
ClassElement:
|
||||
...
|
||||
FieldDefinition ;
|
||||
|
||||
FieldDefinition:
|
||||
ClassElementName Initializer_opt
|
||||
|
||||
ClassElementName:
|
||||
PropertyName
|
||||
|
||||
---*/
|
||||
|
||||
|
||||
var C = class {
|
||||
static async *m() { return 42; } a
|
||||
b = 42;;
|
||||
|
||||
}
|
||||
|
||||
var c = new C();
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "m"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false);
|
||||
|
||||
verifyProperty(C, "m", {
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
writable: true,
|
||||
}, {restore: true});
|
||||
|
||||
C.m().next().then(function(v) {
|
||||
assert.sameValue(v.value, 42);
|
||||
assert.sameValue(v.done, true);
|
||||
|
||||
function assertions() {
|
||||
// Cover $DONE handler for async cases.
|
||||
function $DONE(error) {
|
||||
if (error) {
|
||||
throw new Test262Error('Test262:AsyncTestFailure')
|
||||
}
|
||||
}
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "a"), false);
|
||||
|
||||
verifyProperty(c, "a", {
|
||||
value: undefined,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "b"), false);
|
||||
|
||||
verifyProperty(c, "b", {
|
||||
value: 42,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
}
|
||||
|
||||
return Promise.resolve(assertions());
|
||||
}, $DONE).then($DONE, $DONE);
|
|
@ -0,0 +1,73 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-fields/literal-names-asi.case
|
||||
// - src/class-fields/productions/cls-expr-after-same-line-static-async-method.template
|
||||
/*---
|
||||
description: Literal property names with ASI (field definitions after a static async method in the same line)
|
||||
esid: prod-FieldDefinition
|
||||
features: [class, class-fields-public, async-functions]
|
||||
flags: [generated, async]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
ClassElement:
|
||||
...
|
||||
FieldDefinition ;
|
||||
|
||||
FieldDefinition:
|
||||
ClassElementName Initializer_opt
|
||||
|
||||
ClassElementName:
|
||||
PropertyName
|
||||
|
||||
---*/
|
||||
|
||||
|
||||
var C = class {
|
||||
static async m() { return 42; } a
|
||||
b = 42;;
|
||||
|
||||
}
|
||||
|
||||
var c = new C();
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "m"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false);
|
||||
|
||||
verifyProperty(C, "m", {
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
writable: true,
|
||||
}, {restore: true});
|
||||
|
||||
C.m().then(function(v) {
|
||||
assert.sameValue(v, 42);
|
||||
|
||||
function assertions() {
|
||||
// Cover $DONE handler for async cases.
|
||||
function $DONE(error) {
|
||||
if (error) {
|
||||
throw new Test262Error('Test262:AsyncTestFailure')
|
||||
}
|
||||
}
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "a"), false);
|
||||
|
||||
verifyProperty(c, "a", {
|
||||
value: undefined,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "b"), false);
|
||||
|
||||
verifyProperty(c, "b", {
|
||||
value: 42,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
}
|
||||
|
||||
return Promise.resolve(assertions());
|
||||
}, $DONE).then($DONE, $DONE);
|
|
@ -0,0 +1,60 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-fields/literal-names-asi.case
|
||||
// - src/class-fields/productions/cls-expr-after-same-line-static-gen.template
|
||||
/*---
|
||||
description: Literal property names with ASI (field definitions after a static generator in the same line)
|
||||
esid: prod-FieldDefinition
|
||||
features: [generators, class, class-fields-public]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
ClassElement:
|
||||
...
|
||||
FieldDefinition ;
|
||||
|
||||
FieldDefinition:
|
||||
ClassElementName Initializer_opt
|
||||
|
||||
ClassElementName:
|
||||
PropertyName
|
||||
|
||||
---*/
|
||||
|
||||
|
||||
var C = class {
|
||||
static *m() { return 42; } a
|
||||
b = 42;;
|
||||
|
||||
}
|
||||
|
||||
var c = new C();
|
||||
|
||||
assert.sameValue(C.m().next().value, 42);
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "m"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false);
|
||||
|
||||
verifyProperty(C, "m", {
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
writable: true,
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "a"), false);
|
||||
|
||||
verifyProperty(c, "a", {
|
||||
value: undefined,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "b"), false);
|
||||
|
||||
verifyProperty(c, "b", {
|
||||
value: 42,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
|
@ -0,0 +1,60 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-fields/literal-names-asi.case
|
||||
// - src/class-fields/productions/cls-expr-after-same-line-static-method.template
|
||||
/*---
|
||||
description: Literal property names with ASI (field definitions after a static method in the same line)
|
||||
esid: prod-FieldDefinition
|
||||
features: [class, class-fields-public]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
ClassElement:
|
||||
...
|
||||
FieldDefinition ;
|
||||
|
||||
FieldDefinition:
|
||||
ClassElementName Initializer_opt
|
||||
|
||||
ClassElementName:
|
||||
PropertyName
|
||||
|
||||
---*/
|
||||
|
||||
|
||||
var C = class {
|
||||
static m() { return 42; } a
|
||||
b = 42;;
|
||||
|
||||
}
|
||||
|
||||
var c = new C();
|
||||
|
||||
assert.sameValue(C.m(), 42);
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "m"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false);
|
||||
|
||||
verifyProperty(C, "m", {
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
writable: true,
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "a"), false);
|
||||
|
||||
verifyProperty(c, "a", {
|
||||
value: undefined,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "b"), false);
|
||||
|
||||
verifyProperty(c, "b", {
|
||||
value: 42,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
|
@ -0,0 +1,96 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-fields/literal-names-asi.case
|
||||
// - src/class-fields/productions/cls-expr-multiple-definitions.template
|
||||
/*---
|
||||
description: Literal property names with ASI (multiple fields definitions)
|
||||
esid: prod-FieldDefinition
|
||||
features: [class, class-fields-public]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
ClassElement:
|
||||
...
|
||||
FieldDefinition ;
|
||||
|
||||
FieldDefinition:
|
||||
ClassElementName Initializer_opt
|
||||
|
||||
ClassElementName:
|
||||
PropertyName
|
||||
|
||||
---*/
|
||||
|
||||
|
||||
var C = class {
|
||||
foo = "foobar";
|
||||
m() { return 42 }
|
||||
a
|
||||
b = 42;
|
||||
m2() { return 39 }
|
||||
bar = "barbaz";
|
||||
|
||||
}
|
||||
|
||||
var c = new C();
|
||||
|
||||
assert.sameValue(c.m(), 42);
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "m"), false);
|
||||
assert.sameValue(c.m, C.prototype.m);
|
||||
|
||||
verifyProperty(C.prototype, "m", {
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
writable: true,
|
||||
});
|
||||
|
||||
assert.sameValue(c.m2(), 39);
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "m2"), false);
|
||||
assert.sameValue(c.m2, C.prototype.m2);
|
||||
|
||||
verifyProperty(C.prototype, "m2", {
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
writable: true,
|
||||
});
|
||||
|
||||
assert.sameValue(c.foo, "foobar");
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false);
|
||||
|
||||
verifyProperty(c, "foo", {
|
||||
value: "foobar",
|
||||
enumerable: true,
|
||||
configurable: true,
|
||||
writable: true,
|
||||
});
|
||||
|
||||
assert.sameValue(c.bar, "barbaz");
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false);
|
||||
|
||||
verifyProperty(c, "bar", {
|
||||
value: "barbaz",
|
||||
enumerable: true,
|
||||
configurable: true,
|
||||
writable: true,
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "a"), false);
|
||||
|
||||
verifyProperty(c, "a", {
|
||||
value: undefined,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "b"), false);
|
||||
|
||||
verifyProperty(c, "b", {
|
||||
value: 42,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
|
@ -0,0 +1,74 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-fields/literal-names-asi.case
|
||||
// - src/class-fields/productions/cls-expr-multiple-stacked-definitions.template
|
||||
/*---
|
||||
description: Literal property names with ASI (multiple stacked fields definitions through ASI)
|
||||
esid: prod-FieldDefinition
|
||||
features: [class, class-fields-public]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
ClassElement:
|
||||
...
|
||||
FieldDefinition ;
|
||||
|
||||
FieldDefinition:
|
||||
ClassElementName Initializer_opt
|
||||
|
||||
ClassElementName:
|
||||
PropertyName
|
||||
|
||||
---*/
|
||||
|
||||
|
||||
var C = class {
|
||||
a
|
||||
b = 42;
|
||||
foo = "foobar"
|
||||
bar = "barbaz";
|
||||
|
||||
}
|
||||
|
||||
var c = new C();
|
||||
|
||||
assert.sameValue(c.foo, "foobar");
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false);
|
||||
|
||||
verifyProperty(c, "foo", {
|
||||
value: "foobar",
|
||||
enumerable: true,
|
||||
configurable: true,
|
||||
writable: true,
|
||||
});
|
||||
|
||||
assert.sameValue(c.bar, "barbaz");
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false);
|
||||
|
||||
verifyProperty(c, "bar", {
|
||||
value: "barbaz",
|
||||
enumerable: true,
|
||||
configurable: true,
|
||||
writable: true,
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "a"), false);
|
||||
|
||||
verifyProperty(c, "a", {
|
||||
value: undefined,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "b"), false);
|
||||
|
||||
verifyProperty(c, "b", {
|
||||
value: 42,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
|
@ -0,0 +1,61 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-fields/literal-names-asi.case
|
||||
// - src/class-fields/productions/cls-expr-new-no-sc-line-method.template
|
||||
/*---
|
||||
description: Literal property names with ASI (field definitions followed by a method in a new line without a semicolon)
|
||||
esid: prod-FieldDefinition
|
||||
features: [class, class-fields-public]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
ClassElement:
|
||||
...
|
||||
FieldDefinition ;
|
||||
|
||||
FieldDefinition:
|
||||
ClassElementName Initializer_opt
|
||||
|
||||
ClassElementName:
|
||||
PropertyName
|
||||
|
||||
---*/
|
||||
|
||||
|
||||
var C = class {
|
||||
a
|
||||
b = 42;
|
||||
m() { return 42; }
|
||||
|
||||
}
|
||||
|
||||
var c = new C();
|
||||
|
||||
assert.sameValue(c.m(), 42);
|
||||
assert.sameValue(c.m, C.prototype.m);
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "m"), false);
|
||||
|
||||
verifyProperty(C.prototype, "m", {
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
writable: true,
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "a"), false);
|
||||
|
||||
verifyProperty(c, "a", {
|
||||
value: undefined,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "b"), false);
|
||||
|
||||
verifyProperty(c, "b", {
|
||||
value: 42,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
|
@ -0,0 +1,61 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-fields/literal-names-asi.case
|
||||
// - src/class-fields/productions/cls-expr-new-sc-line-generator.template
|
||||
/*---
|
||||
description: Literal property names with ASI (field definitions followed by a method in a new line with a semicolon)
|
||||
esid: prod-FieldDefinition
|
||||
features: [class, class-fields-public, generators]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
ClassElement:
|
||||
...
|
||||
FieldDefinition ;
|
||||
|
||||
FieldDefinition:
|
||||
ClassElementName Initializer_opt
|
||||
|
||||
ClassElementName:
|
||||
PropertyName
|
||||
|
||||
---*/
|
||||
|
||||
|
||||
var C = class {
|
||||
a
|
||||
b = 42;;
|
||||
*m() { return 42; }
|
||||
|
||||
}
|
||||
|
||||
var c = new C();
|
||||
|
||||
assert.sameValue(c.m().next().value, 42);
|
||||
assert.sameValue(c.m, C.prototype.m);
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "m"), false);
|
||||
|
||||
verifyProperty(C.prototype, "m", {
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
writable: true,
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "a"), false);
|
||||
|
||||
verifyProperty(c, "a", {
|
||||
value: undefined,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "b"), false);
|
||||
|
||||
verifyProperty(c, "b", {
|
||||
value: 42,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
|
@ -0,0 +1,61 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-fields/literal-names-asi.case
|
||||
// - src/class-fields/productions/cls-expr-new-sc-line-method.template
|
||||
/*---
|
||||
description: Literal property names with ASI (field definitions followed by a method in a new line with a semicolon)
|
||||
esid: prod-FieldDefinition
|
||||
features: [class, class-fields-public]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
ClassElement:
|
||||
...
|
||||
FieldDefinition ;
|
||||
|
||||
FieldDefinition:
|
||||
ClassElementName Initializer_opt
|
||||
|
||||
ClassElementName:
|
||||
PropertyName
|
||||
|
||||
---*/
|
||||
|
||||
|
||||
var C = class {
|
||||
a
|
||||
b = 42;;
|
||||
m() { return 42; }
|
||||
|
||||
}
|
||||
|
||||
var c = new C();
|
||||
|
||||
assert.sameValue(c.m(), 42);
|
||||
assert.sameValue(c.m, C.prototype.m);
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "m"), false);
|
||||
|
||||
verifyProperty(C.prototype, "m", {
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
writable: true,
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "a"), false);
|
||||
|
||||
verifyProperty(c, "a", {
|
||||
value: undefined,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "b"), false);
|
||||
|
||||
verifyProperty(c, "b", {
|
||||
value: 42,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
|
@ -0,0 +1,50 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-fields/literal-names-asi.case
|
||||
// - src/class-fields/productions/cls-expr-regular-definitions.template
|
||||
/*---
|
||||
description: Literal property names with ASI (regular fields defintion)
|
||||
esid: prod-FieldDefinition
|
||||
features: [class, class-fields-public]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
ClassElement:
|
||||
...
|
||||
FieldDefinition ;
|
||||
|
||||
FieldDefinition:
|
||||
ClassElementName Initializer_opt
|
||||
|
||||
ClassElementName:
|
||||
PropertyName
|
||||
|
||||
---*/
|
||||
|
||||
|
||||
var C = class {
|
||||
a
|
||||
b = 42;
|
||||
|
||||
}
|
||||
|
||||
var c = new C();
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "a"), false);
|
||||
|
||||
verifyProperty(c, "a", {
|
||||
value: undefined,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "b"), false);
|
||||
|
||||
verifyProperty(c, "b", {
|
||||
value: 42,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
|
@ -0,0 +1,74 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-fields/literal-names-asi.case
|
||||
// - src/class-fields/productions/cls-expr-after-same-line-async-gen.template
|
||||
/*---
|
||||
description: Literal property names with ASI (field definitions after an async generator in the same line)
|
||||
esid: prod-FieldDefinition
|
||||
features: [class, class-fields-public, async-iteration]
|
||||
flags: [generated, async]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
ClassElement:
|
||||
...
|
||||
FieldDefinition ;
|
||||
|
||||
FieldDefinition:
|
||||
ClassElementName Initializer_opt
|
||||
|
||||
ClassElementName:
|
||||
PropertyName
|
||||
|
||||
---*/
|
||||
|
||||
|
||||
var C = class {
|
||||
async *m() { return 42; } a
|
||||
b = 42;;
|
||||
|
||||
}
|
||||
|
||||
var c = new C();
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "m"), false);
|
||||
assert.sameValue(c.m, C.prototype.m);
|
||||
|
||||
verifyProperty(C.prototype, "m", {
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
writable: true,
|
||||
}, {restore: true});
|
||||
|
||||
c.m().next().then(function(v) {
|
||||
assert.sameValue(v.value, 42);
|
||||
assert.sameValue(v.done, true);
|
||||
|
||||
function assertions() {
|
||||
// Cover $DONE handler for async cases.
|
||||
function $DONE(error) {
|
||||
if (error) {
|
||||
throw new Test262Error('Test262:AsyncTestFailure')
|
||||
}
|
||||
}
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "a"), false);
|
||||
|
||||
verifyProperty(c, "a", {
|
||||
value: undefined,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "b"), false);
|
||||
|
||||
verifyProperty(c, "b", {
|
||||
value: 42,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
}
|
||||
|
||||
return Promise.resolve(assertions());
|
||||
}, $DONE).then($DONE, $DONE);
|
|
@ -0,0 +1,73 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-fields/literal-names-asi.case
|
||||
// - src/class-fields/productions/cls-expr-after-same-line-async-method.template
|
||||
/*---
|
||||
description: Literal property names with ASI (field definitions after an async method in the same line)
|
||||
esid: prod-FieldDefinition
|
||||
features: [class, class-fields-public, async-functions]
|
||||
flags: [generated, async]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
ClassElement:
|
||||
...
|
||||
FieldDefinition ;
|
||||
|
||||
FieldDefinition:
|
||||
ClassElementName Initializer_opt
|
||||
|
||||
ClassElementName:
|
||||
PropertyName
|
||||
|
||||
---*/
|
||||
|
||||
|
||||
var C = class {
|
||||
async m() { return 42; } a
|
||||
b = 42;;
|
||||
|
||||
}
|
||||
|
||||
var c = new C();
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "m"), false);
|
||||
assert.sameValue(c.m, C.prototype.m);
|
||||
|
||||
verifyProperty(C.prototype, "m", {
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
writable: true,
|
||||
}, {restore: true});
|
||||
|
||||
c.m().then(function(v) {
|
||||
assert.sameValue(v, 42);
|
||||
|
||||
function assertions() {
|
||||
// Cover $DONE handler for async cases.
|
||||
function $DONE(error) {
|
||||
if (error) {
|
||||
throw new Test262Error('Test262:AsyncTestFailure')
|
||||
}
|
||||
}
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "a"), false);
|
||||
|
||||
verifyProperty(c, "a", {
|
||||
value: undefined,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "b"), false);
|
||||
|
||||
verifyProperty(c, "b", {
|
||||
value: 42,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
}
|
||||
|
||||
return Promise.resolve(assertions());
|
||||
}, $DONE).then($DONE, $DONE);
|
|
@ -0,0 +1,60 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-fields/literal-names-asi.case
|
||||
// - src/class-fields/productions/cls-expr-same-line-generator.template
|
||||
/*---
|
||||
description: Literal property names with ASI (field definitions followed by a generator method in the same line)
|
||||
esid: prod-FieldDefinition
|
||||
features: [class, class-fields-public, generators]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
ClassElement:
|
||||
...
|
||||
FieldDefinition ;
|
||||
|
||||
FieldDefinition:
|
||||
ClassElementName Initializer_opt
|
||||
|
||||
ClassElementName:
|
||||
PropertyName
|
||||
|
||||
---*/
|
||||
|
||||
|
||||
var C = class {
|
||||
a
|
||||
b = 42;; *m() { return 42; }
|
||||
|
||||
}
|
||||
|
||||
var c = new C();
|
||||
|
||||
assert.sameValue(c.m().next().value, 42);
|
||||
assert.sameValue(c.m, C.prototype.m);
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "m"), false);
|
||||
|
||||
verifyProperty(C.prototype, "m", {
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
writable: true,
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "a"), false);
|
||||
|
||||
verifyProperty(c, "a", {
|
||||
value: undefined,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "b"), false);
|
||||
|
||||
verifyProperty(c, "b", {
|
||||
value: 42,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
|
@ -0,0 +1,60 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-fields/literal-names-asi.case
|
||||
// - src/class-fields/productions/cls-expr-same-line-method.template
|
||||
/*---
|
||||
description: Literal property names with ASI (field definitions followed by a method in the same line)
|
||||
esid: prod-FieldDefinition
|
||||
features: [class, class-fields-public]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
ClassElement:
|
||||
...
|
||||
FieldDefinition ;
|
||||
|
||||
FieldDefinition:
|
||||
ClassElementName Initializer_opt
|
||||
|
||||
ClassElementName:
|
||||
PropertyName
|
||||
|
||||
---*/
|
||||
|
||||
|
||||
var C = class {
|
||||
a
|
||||
b = 42;; m() { return 42; }
|
||||
|
||||
}
|
||||
|
||||
var c = new C();
|
||||
|
||||
assert.sameValue(c.m(), 42);
|
||||
assert.sameValue(c.m, C.prototype.m);
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "m"), false);
|
||||
|
||||
verifyProperty(C.prototype, "m", {
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
writable: true,
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "a"), false);
|
||||
|
||||
verifyProperty(c, "a", {
|
||||
value: undefined,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "b"), false);
|
||||
|
||||
verifyProperty(c, "b", {
|
||||
value: 42,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
|
@ -0,0 +1,52 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-fields/literal-names-asi.case
|
||||
// - src/class-fields/productions/cls-expr-wrapped-in-sc.template
|
||||
/*---
|
||||
description: Literal property names with ASI (fields definition wrapped in semicolons)
|
||||
esid: prod-FieldDefinition
|
||||
features: [class, class-fields-public]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
ClassElement:
|
||||
...
|
||||
FieldDefinition ;
|
||||
|
||||
FieldDefinition:
|
||||
ClassElementName Initializer_opt
|
||||
|
||||
ClassElementName:
|
||||
PropertyName
|
||||
|
||||
---*/
|
||||
|
||||
|
||||
var C = class {
|
||||
;;;;
|
||||
;;;;;;a
|
||||
b = 42;;;;;;;;
|
||||
;;;;
|
||||
|
||||
}
|
||||
|
||||
var c = new C();
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "a"), false);
|
||||
|
||||
verifyProperty(c, "a", {
|
||||
value: undefined,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "b"), false);
|
||||
|
||||
verifyProperty(c, "b", {
|
||||
value: 42,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
|
@ -1,35 +0,0 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-fields/grammar-field-def-has-initializer-no-sc-error.case
|
||||
// - src/class-fields/syntax/invalid/cls-expr-fields-invalid-syntax.template
|
||||
/*---
|
||||
description: SyntaxError (class expression)
|
||||
esid: prod-ClassElement
|
||||
features: [class-fields-private, class]
|
||||
flags: [generated]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
info: |
|
||||
|
||||
ClassElement :
|
||||
MethodDefinition
|
||||
static MethodDefinition
|
||||
FieldDefinition ;
|
||||
;
|
||||
|
||||
FieldDefinition :
|
||||
ClassElementName Initializer _opt
|
||||
|
||||
ClassElementName :
|
||||
PropertyName
|
||||
PrivateName
|
||||
|
||||
---*/
|
||||
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
var C = class {
|
||||
x = []
|
||||
y;
|
||||
};
|
|
@ -0,0 +1,60 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-fields/literal-names-asi.case
|
||||
// - src/class-fields/productions/cls-decl-after-same-line-gen.template
|
||||
/*---
|
||||
description: Literal property names with ASI (field definitions after a generator in the same line)
|
||||
esid: prod-FieldDefinition
|
||||
features: [generators, class, class-fields-public]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
ClassElement:
|
||||
...
|
||||
FieldDefinition ;
|
||||
|
||||
FieldDefinition:
|
||||
ClassElementName Initializer_opt
|
||||
|
||||
ClassElementName:
|
||||
PropertyName
|
||||
|
||||
---*/
|
||||
|
||||
|
||||
class C {
|
||||
*m() { return 42; } a
|
||||
b = 42;;
|
||||
|
||||
}
|
||||
|
||||
var c = new C();
|
||||
|
||||
assert.sameValue(c.m().next().value, 42);
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "m"), false);
|
||||
assert.sameValue(c.m, C.prototype.m);
|
||||
|
||||
verifyProperty(C.prototype, "m", {
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
writable: true,
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "a"), false);
|
||||
|
||||
verifyProperty(c, "a", {
|
||||
value: undefined,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "b"), false);
|
||||
|
||||
verifyProperty(c, "b", {
|
||||
value: 42,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
|
@ -0,0 +1,60 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-fields/literal-names-asi.case
|
||||
// - src/class-fields/productions/cls-decl-after-same-line-method.template
|
||||
/*---
|
||||
description: Literal property names with ASI (field definitions after a method in the same line)
|
||||
esid: prod-FieldDefinition
|
||||
features: [class, class-fields-public]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
ClassElement:
|
||||
...
|
||||
FieldDefinition ;
|
||||
|
||||
FieldDefinition:
|
||||
ClassElementName Initializer_opt
|
||||
|
||||
ClassElementName:
|
||||
PropertyName
|
||||
|
||||
---*/
|
||||
|
||||
|
||||
class C {
|
||||
m() { return 42; } a
|
||||
b = 42;;
|
||||
|
||||
}
|
||||
|
||||
var c = new C();
|
||||
|
||||
assert.sameValue(c.m(), 42);
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "m"), false);
|
||||
assert.sameValue(c.m, C.prototype.m);
|
||||
|
||||
verifyProperty(C.prototype, "m", {
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
writable: true,
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "a"), false);
|
||||
|
||||
verifyProperty(c, "a", {
|
||||
value: undefined,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "b"), false);
|
||||
|
||||
verifyProperty(c, "b", {
|
||||
value: 42,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
|
@ -0,0 +1,74 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-fields/literal-names-asi.case
|
||||
// - src/class-fields/productions/cls-decl-after-same-line-static-async-gen.template
|
||||
/*---
|
||||
description: Literal property names with ASI (field definitions after a static async generator in the same line)
|
||||
esid: prod-FieldDefinition
|
||||
features: [class, class-fields-public, async-iteration]
|
||||
flags: [generated, async]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
ClassElement:
|
||||
...
|
||||
FieldDefinition ;
|
||||
|
||||
FieldDefinition:
|
||||
ClassElementName Initializer_opt
|
||||
|
||||
ClassElementName:
|
||||
PropertyName
|
||||
|
||||
---*/
|
||||
|
||||
|
||||
class C {
|
||||
static async *m() { return 42; } a
|
||||
b = 42;;
|
||||
|
||||
}
|
||||
|
||||
var c = new C();
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "m"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false);
|
||||
|
||||
verifyProperty(C, "m", {
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
writable: true,
|
||||
}, {restore: true});
|
||||
|
||||
C.m().next().then(function(v) {
|
||||
assert.sameValue(v.value, 42);
|
||||
assert.sameValue(v.done, true);
|
||||
|
||||
function assertions() {
|
||||
// Cover $DONE handler for async cases.
|
||||
function $DONE(error) {
|
||||
if (error) {
|
||||
throw new Test262Error('Test262:AsyncTestFailure')
|
||||
}
|
||||
}
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "a"), false);
|
||||
|
||||
verifyProperty(c, "a", {
|
||||
value: undefined,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "b"), false);
|
||||
|
||||
verifyProperty(c, "b", {
|
||||
value: 42,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
}
|
||||
|
||||
return Promise.resolve(assertions());
|
||||
}, $DONE).then($DONE, $DONE);
|
|
@ -0,0 +1,73 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-fields/literal-names-asi.case
|
||||
// - src/class-fields/productions/cls-decl-after-same-line-static-async-method.template
|
||||
/*---
|
||||
description: Literal property names with ASI (field definitions after a static async method in the same line)
|
||||
esid: prod-FieldDefinition
|
||||
features: [class, class-fields-public, async-functions]
|
||||
flags: [generated, async]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
ClassElement:
|
||||
...
|
||||
FieldDefinition ;
|
||||
|
||||
FieldDefinition:
|
||||
ClassElementName Initializer_opt
|
||||
|
||||
ClassElementName:
|
||||
PropertyName
|
||||
|
||||
---*/
|
||||
|
||||
|
||||
class C {
|
||||
static async m() { return 42; } a
|
||||
b = 42;;
|
||||
|
||||
}
|
||||
|
||||
var c = new C();
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "m"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false);
|
||||
|
||||
verifyProperty(C, "m", {
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
writable: true,
|
||||
}, {restore: true});
|
||||
|
||||
C.m().then(function(v) {
|
||||
assert.sameValue(v, 42);
|
||||
|
||||
function assertions() {
|
||||
// Cover $DONE handler for async cases.
|
||||
function $DONE(error) {
|
||||
if (error) {
|
||||
throw new Test262Error('Test262:AsyncTestFailure')
|
||||
}
|
||||
}
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "a"), false);
|
||||
|
||||
verifyProperty(c, "a", {
|
||||
value: undefined,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "b"), false);
|
||||
|
||||
verifyProperty(c, "b", {
|
||||
value: 42,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
}
|
||||
|
||||
return Promise.resolve(assertions());
|
||||
}, $DONE).then($DONE, $DONE);
|
|
@ -0,0 +1,60 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-fields/literal-names-asi.case
|
||||
// - src/class-fields/productions/cls-decl-after-same-line-static-gen.template
|
||||
/*---
|
||||
description: Literal property names with ASI (field definitions after a static generator in the same line)
|
||||
esid: prod-FieldDefinition
|
||||
features: [generators, class, class-fields-public]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
ClassElement:
|
||||
...
|
||||
FieldDefinition ;
|
||||
|
||||
FieldDefinition:
|
||||
ClassElementName Initializer_opt
|
||||
|
||||
ClassElementName:
|
||||
PropertyName
|
||||
|
||||
---*/
|
||||
|
||||
|
||||
class C {
|
||||
static *m() { return 42; } a
|
||||
b = 42;;
|
||||
|
||||
}
|
||||
|
||||
var c = new C();
|
||||
|
||||
assert.sameValue(C.m().next().value, 42);
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "m"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false);
|
||||
|
||||
verifyProperty(C, "m", {
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
writable: true,
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "a"), false);
|
||||
|
||||
verifyProperty(c, "a", {
|
||||
value: undefined,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "b"), false);
|
||||
|
||||
verifyProperty(c, "b", {
|
||||
value: 42,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
|
@ -0,0 +1,60 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-fields/literal-names-asi.case
|
||||
// - src/class-fields/productions/cls-decl-after-same-line-static-method.template
|
||||
/*---
|
||||
description: Literal property names with ASI (field definitions after a static method in the same line)
|
||||
esid: prod-FieldDefinition
|
||||
features: [class, class-fields-public]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
ClassElement:
|
||||
...
|
||||
FieldDefinition ;
|
||||
|
||||
FieldDefinition:
|
||||
ClassElementName Initializer_opt
|
||||
|
||||
ClassElementName:
|
||||
PropertyName
|
||||
|
||||
---*/
|
||||
|
||||
|
||||
class C {
|
||||
static m() { return 42; } a
|
||||
b = 42;;
|
||||
|
||||
}
|
||||
|
||||
var c = new C();
|
||||
|
||||
assert.sameValue(C.m(), 42);
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "m"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false);
|
||||
|
||||
verifyProperty(C, "m", {
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
writable: true,
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "a"), false);
|
||||
|
||||
verifyProperty(c, "a", {
|
||||
value: undefined,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "b"), false);
|
||||
|
||||
verifyProperty(c, "b", {
|
||||
value: 42,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
|
@ -0,0 +1,96 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-fields/literal-names-asi.case
|
||||
// - src/class-fields/productions/cls-decl-multiple-definitions.template
|
||||
/*---
|
||||
description: Literal property names with ASI (multiple fields definitions)
|
||||
esid: prod-FieldDefinition
|
||||
features: [class, class-fields-public]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
ClassElement:
|
||||
...
|
||||
FieldDefinition ;
|
||||
|
||||
FieldDefinition:
|
||||
ClassElementName Initializer_opt
|
||||
|
||||
ClassElementName:
|
||||
PropertyName
|
||||
|
||||
---*/
|
||||
|
||||
|
||||
class C {
|
||||
foo = "foobar";
|
||||
m() { return 42 }
|
||||
a
|
||||
b = 42;
|
||||
m2() { return 39 }
|
||||
bar = "barbaz";
|
||||
|
||||
}
|
||||
|
||||
var c = new C();
|
||||
|
||||
assert.sameValue(c.m(), 42);
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "m"), false);
|
||||
assert.sameValue(c.m, C.prototype.m);
|
||||
|
||||
verifyProperty(C.prototype, "m", {
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
writable: true,
|
||||
});
|
||||
|
||||
assert.sameValue(c.m2(), 39);
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "m2"), false);
|
||||
assert.sameValue(c.m2, C.prototype.m2);
|
||||
|
||||
verifyProperty(C.prototype, "m2", {
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
writable: true,
|
||||
});
|
||||
|
||||
assert.sameValue(c.foo, "foobar");
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false);
|
||||
|
||||
verifyProperty(c, "foo", {
|
||||
value: "foobar",
|
||||
enumerable: true,
|
||||
configurable: true,
|
||||
writable: true,
|
||||
});
|
||||
|
||||
assert.sameValue(c.bar, "barbaz");
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false);
|
||||
|
||||
verifyProperty(c, "bar", {
|
||||
value: "barbaz",
|
||||
enumerable: true,
|
||||
configurable: true,
|
||||
writable: true,
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "a"), false);
|
||||
|
||||
verifyProperty(c, "a", {
|
||||
value: undefined,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "b"), false);
|
||||
|
||||
verifyProperty(c, "b", {
|
||||
value: 42,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
|
@ -0,0 +1,74 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-fields/literal-names-asi.case
|
||||
// - src/class-fields/productions/cls-decl-multiple-stacked-definitions.template
|
||||
/*---
|
||||
description: Literal property names with ASI (multiple stacked fields definitions through ASI)
|
||||
esid: prod-FieldDefinition
|
||||
features: [class, class-fields-public]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
ClassElement:
|
||||
...
|
||||
FieldDefinition ;
|
||||
|
||||
FieldDefinition:
|
||||
ClassElementName Initializer_opt
|
||||
|
||||
ClassElementName:
|
||||
PropertyName
|
||||
|
||||
---*/
|
||||
|
||||
|
||||
class C {
|
||||
a
|
||||
b = 42;
|
||||
foo = "foobar"
|
||||
bar = "barbaz";
|
||||
|
||||
}
|
||||
|
||||
var c = new C();
|
||||
|
||||
assert.sameValue(c.foo, "foobar");
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false);
|
||||
|
||||
verifyProperty(c, "foo", {
|
||||
value: "foobar",
|
||||
enumerable: true,
|
||||
configurable: true,
|
||||
writable: true,
|
||||
});
|
||||
|
||||
assert.sameValue(c.bar, "barbaz");
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false);
|
||||
|
||||
verifyProperty(c, "bar", {
|
||||
value: "barbaz",
|
||||
enumerable: true,
|
||||
configurable: true,
|
||||
writable: true,
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "a"), false);
|
||||
|
||||
verifyProperty(c, "a", {
|
||||
value: undefined,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "b"), false);
|
||||
|
||||
verifyProperty(c, "b", {
|
||||
value: 42,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
|
@ -0,0 +1,61 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-fields/literal-names-asi.case
|
||||
// - src/class-fields/productions/cls-decl-new-no-sc-line-method.template
|
||||
/*---
|
||||
description: Literal property names with ASI (field definitions followed by a method in a new line without a semicolon)
|
||||
esid: prod-FieldDefinition
|
||||
features: [class, class-fields-public]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
ClassElement:
|
||||
...
|
||||
FieldDefinition ;
|
||||
|
||||
FieldDefinition:
|
||||
ClassElementName Initializer_opt
|
||||
|
||||
ClassElementName:
|
||||
PropertyName
|
||||
|
||||
---*/
|
||||
|
||||
|
||||
class C {
|
||||
a
|
||||
b = 42;
|
||||
m() { return 42; }
|
||||
|
||||
}
|
||||
|
||||
var c = new C();
|
||||
|
||||
assert.sameValue(c.m(), 42);
|
||||
assert.sameValue(c.m, C.prototype.m);
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "m"), false);
|
||||
|
||||
verifyProperty(C.prototype, "m", {
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
writable: true,
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "a"), false);
|
||||
|
||||
verifyProperty(c, "a", {
|
||||
value: undefined,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "b"), false);
|
||||
|
||||
verifyProperty(c, "b", {
|
||||
value: 42,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
|
@ -0,0 +1,61 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-fields/literal-names-asi.case
|
||||
// - src/class-fields/productions/cls-decl-new-sc-line-generator.template
|
||||
/*---
|
||||
description: Literal property names with ASI (field definitions followed by a method in a new line with a semicolon)
|
||||
esid: prod-FieldDefinition
|
||||
features: [class, class-fields-public, generators]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
ClassElement:
|
||||
...
|
||||
FieldDefinition ;
|
||||
|
||||
FieldDefinition:
|
||||
ClassElementName Initializer_opt
|
||||
|
||||
ClassElementName:
|
||||
PropertyName
|
||||
|
||||
---*/
|
||||
|
||||
|
||||
class C {
|
||||
a
|
||||
b = 42;;
|
||||
*m() { return 42; }
|
||||
|
||||
}
|
||||
|
||||
var c = new C();
|
||||
|
||||
assert.sameValue(c.m().next().value, 42);
|
||||
assert.sameValue(c.m, C.prototype.m);
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "m"), false);
|
||||
|
||||
verifyProperty(C.prototype, "m", {
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
writable: true,
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "a"), false);
|
||||
|
||||
verifyProperty(c, "a", {
|
||||
value: undefined,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "b"), false);
|
||||
|
||||
verifyProperty(c, "b", {
|
||||
value: 42,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
|
@ -0,0 +1,61 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-fields/literal-names-asi.case
|
||||
// - src/class-fields/productions/cls-decl-new-sc-line-method.template
|
||||
/*---
|
||||
description: Literal property names with ASI (field definitions followed by a method in a new line with a semicolon)
|
||||
esid: prod-FieldDefinition
|
||||
features: [class, class-fields-public]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
ClassElement:
|
||||
...
|
||||
FieldDefinition ;
|
||||
|
||||
FieldDefinition:
|
||||
ClassElementName Initializer_opt
|
||||
|
||||
ClassElementName:
|
||||
PropertyName
|
||||
|
||||
---*/
|
||||
|
||||
|
||||
class C {
|
||||
a
|
||||
b = 42;;
|
||||
m() { return 42; }
|
||||
|
||||
}
|
||||
|
||||
var c = new C();
|
||||
|
||||
assert.sameValue(c.m(), 42);
|
||||
assert.sameValue(c.m, C.prototype.m);
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "m"), false);
|
||||
|
||||
verifyProperty(C.prototype, "m", {
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
writable: true,
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "a"), false);
|
||||
|
||||
verifyProperty(c, "a", {
|
||||
value: undefined,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "b"), false);
|
||||
|
||||
verifyProperty(c, "b", {
|
||||
value: 42,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
|
@ -0,0 +1,50 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-fields/literal-names-asi.case
|
||||
// - src/class-fields/productions/cls-decl-regular-definitions.template
|
||||
/*---
|
||||
description: Literal property names with ASI (regular fields defintion)
|
||||
esid: prod-FieldDefinition
|
||||
features: [class, class-fields-public]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
ClassElement:
|
||||
...
|
||||
FieldDefinition ;
|
||||
|
||||
FieldDefinition:
|
||||
ClassElementName Initializer_opt
|
||||
|
||||
ClassElementName:
|
||||
PropertyName
|
||||
|
||||
---*/
|
||||
|
||||
|
||||
class C {
|
||||
a
|
||||
b = 42;
|
||||
|
||||
}
|
||||
|
||||
var c = new C();
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "a"), false);
|
||||
|
||||
verifyProperty(c, "a", {
|
||||
value: undefined,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "b"), false);
|
||||
|
||||
verifyProperty(c, "b", {
|
||||
value: 42,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
|
@ -0,0 +1,74 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-fields/literal-names-asi.case
|
||||
// - src/class-fields/productions/cls-decl-after-same-line-async-gen.template
|
||||
/*---
|
||||
description: Literal property names with ASI (field definitions after an async generator in the same line)
|
||||
esid: prod-FieldDefinition
|
||||
features: [class, class-fields-public, async-iteration]
|
||||
flags: [generated, async]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
ClassElement:
|
||||
...
|
||||
FieldDefinition ;
|
||||
|
||||
FieldDefinition:
|
||||
ClassElementName Initializer_opt
|
||||
|
||||
ClassElementName:
|
||||
PropertyName
|
||||
|
||||
---*/
|
||||
|
||||
|
||||
class C {
|
||||
async *m() { return 42; } a
|
||||
b = 42;;
|
||||
|
||||
}
|
||||
|
||||
var c = new C();
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "m"), false);
|
||||
assert.sameValue(c.m, C.prototype.m);
|
||||
|
||||
verifyProperty(C.prototype, "m", {
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
writable: true,
|
||||
}, {restore: true});
|
||||
|
||||
c.m().next().then(function(v) {
|
||||
assert.sameValue(v.value, 42);
|
||||
assert.sameValue(v.done, true);
|
||||
|
||||
function assertions() {
|
||||
// Cover $DONE handler for async cases.
|
||||
function $DONE(error) {
|
||||
if (error) {
|
||||
throw new Test262Error('Test262:AsyncTestFailure')
|
||||
}
|
||||
}
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "a"), false);
|
||||
|
||||
verifyProperty(c, "a", {
|
||||
value: undefined,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "b"), false);
|
||||
|
||||
verifyProperty(c, "b", {
|
||||
value: 42,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
}
|
||||
|
||||
return Promise.resolve(assertions());
|
||||
}, $DONE).then($DONE, $DONE);
|
|
@ -0,0 +1,73 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-fields/literal-names-asi.case
|
||||
// - src/class-fields/productions/cls-decl-after-same-line-async-method.template
|
||||
/*---
|
||||
description: Literal property names with ASI (field definitions after an async method in the same line)
|
||||
esid: prod-FieldDefinition
|
||||
features: [class, class-fields-public, async-functions]
|
||||
flags: [generated, async]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
ClassElement:
|
||||
...
|
||||
FieldDefinition ;
|
||||
|
||||
FieldDefinition:
|
||||
ClassElementName Initializer_opt
|
||||
|
||||
ClassElementName:
|
||||
PropertyName
|
||||
|
||||
---*/
|
||||
|
||||
|
||||
class C {
|
||||
async m() { return 42; } a
|
||||
b = 42;;
|
||||
|
||||
}
|
||||
|
||||
var c = new C();
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "m"), false);
|
||||
assert.sameValue(c.m, C.prototype.m);
|
||||
|
||||
verifyProperty(C.prototype, "m", {
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
writable: true,
|
||||
}, {restore: true});
|
||||
|
||||
c.m().then(function(v) {
|
||||
assert.sameValue(v, 42);
|
||||
|
||||
function assertions() {
|
||||
// Cover $DONE handler for async cases.
|
||||
function $DONE(error) {
|
||||
if (error) {
|
||||
throw new Test262Error('Test262:AsyncTestFailure')
|
||||
}
|
||||
}
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "a"), false);
|
||||
|
||||
verifyProperty(c, "a", {
|
||||
value: undefined,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "b"), false);
|
||||
|
||||
verifyProperty(c, "b", {
|
||||
value: 42,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
}
|
||||
|
||||
return Promise.resolve(assertions());
|
||||
}, $DONE).then($DONE, $DONE);
|
|
@ -0,0 +1,60 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-fields/literal-names-asi.case
|
||||
// - src/class-fields/productions/cls-decl-same-line-generator.template
|
||||
/*---
|
||||
description: Literal property names with ASI (field definitions followed by a generator method in the same line)
|
||||
esid: prod-FieldDefinition
|
||||
features: [class, class-fields-public, generators]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
ClassElement:
|
||||
...
|
||||
FieldDefinition ;
|
||||
|
||||
FieldDefinition:
|
||||
ClassElementName Initializer_opt
|
||||
|
||||
ClassElementName:
|
||||
PropertyName
|
||||
|
||||
---*/
|
||||
|
||||
|
||||
class C {
|
||||
a
|
||||
b = 42;; *m() { return 42; }
|
||||
|
||||
}
|
||||
|
||||
var c = new C();
|
||||
|
||||
assert.sameValue(c.m().next().value, 42);
|
||||
assert.sameValue(c.m, C.prototype.m);
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "m"), false);
|
||||
|
||||
verifyProperty(C.prototype, "m", {
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
writable: true,
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "a"), false);
|
||||
|
||||
verifyProperty(c, "a", {
|
||||
value: undefined,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "b"), false);
|
||||
|
||||
verifyProperty(c, "b", {
|
||||
value: 42,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
|
@ -0,0 +1,60 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-fields/literal-names-asi.case
|
||||
// - src/class-fields/productions/cls-decl-same-line-method.template
|
||||
/*---
|
||||
description: Literal property names with ASI (field definitions followed by a method in the same line)
|
||||
esid: prod-FieldDefinition
|
||||
features: [class, class-fields-public]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
ClassElement:
|
||||
...
|
||||
FieldDefinition ;
|
||||
|
||||
FieldDefinition:
|
||||
ClassElementName Initializer_opt
|
||||
|
||||
ClassElementName:
|
||||
PropertyName
|
||||
|
||||
---*/
|
||||
|
||||
|
||||
class C {
|
||||
a
|
||||
b = 42;; m() { return 42; }
|
||||
|
||||
}
|
||||
|
||||
var c = new C();
|
||||
|
||||
assert.sameValue(c.m(), 42);
|
||||
assert.sameValue(c.m, C.prototype.m);
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "m"), false);
|
||||
|
||||
verifyProperty(C.prototype, "m", {
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
writable: true,
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "a"), false);
|
||||
|
||||
verifyProperty(c, "a", {
|
||||
value: undefined,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "b"), false);
|
||||
|
||||
verifyProperty(c, "b", {
|
||||
value: 42,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
|
@ -0,0 +1,52 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-fields/literal-names-asi.case
|
||||
// - src/class-fields/productions/cls-decl-wrapped-in-sc.template
|
||||
/*---
|
||||
description: Literal property names with ASI (fields definition wrapped in semicolons)
|
||||
esid: prod-FieldDefinition
|
||||
features: [class, class-fields-public]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
ClassElement:
|
||||
...
|
||||
FieldDefinition ;
|
||||
|
||||
FieldDefinition:
|
||||
ClassElementName Initializer_opt
|
||||
|
||||
ClassElementName:
|
||||
PropertyName
|
||||
|
||||
---*/
|
||||
|
||||
|
||||
class C {
|
||||
;;;;
|
||||
;;;;;;a
|
||||
b = 42;;;;;;;;
|
||||
;;;;
|
||||
|
||||
}
|
||||
|
||||
var c = new C();
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "a"), false);
|
||||
|
||||
verifyProperty(c, "a", {
|
||||
value: undefined,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "b"), false);
|
||||
|
||||
verifyProperty(c, "b", {
|
||||
value: 42,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
|
@ -1,35 +0,0 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-fields/grammar-field-def-has-initializer-no-sc-error.case
|
||||
// - src/class-fields/syntax/invalid/cls-decl-fields-invalid-syntax.template
|
||||
/*---
|
||||
description: SyntaxError (class declaration)
|
||||
esid: prod-ClassElement
|
||||
features: [class-fields-private, class]
|
||||
flags: [generated]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
info: |
|
||||
|
||||
ClassElement :
|
||||
MethodDefinition
|
||||
static MethodDefinition
|
||||
FieldDefinition ;
|
||||
;
|
||||
|
||||
FieldDefinition :
|
||||
ClassElementName Initializer _opt
|
||||
|
||||
ClassElementName :
|
||||
PropertyName
|
||||
PrivateName
|
||||
|
||||
---*/
|
||||
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
class C {
|
||||
x = []
|
||||
y;
|
||||
}
|
Loading…
Reference in New Issue