mirror of
https://github.com/tc39/test262.git
synced 2025-07-28 16:34:27 +02:00
Regenerate tests
This commit is contained in:
parent
d50c33a5b3
commit
2e042d9f9d
@ -24,7 +24,7 @@ var x = "b";
|
||||
|
||||
|
||||
var C = class {
|
||||
*m() { return 42; } static ["a"] = 39; [x] = 42; [10] = "meep"; ["not initialized"];
|
||||
*m() { return 42; } [x] = 42; [10] = "meep"; ["not initialized"];
|
||||
|
||||
}
|
||||
|
||||
@ -40,16 +40,6 @@ verifyProperty(C.prototype, "m", {
|
||||
writable: true,
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "a"), false);
|
||||
|
||||
verifyProperty(C, "a", {
|
||||
value: 39,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "b"), false);
|
||||
|
||||
|
@ -1,56 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-fields/static-computed-names.case
|
||||
// - src/class-fields/productions/cls-expr-after-same-line-gen.template
|
||||
/*---
|
||||
description: Static Computed property names (field definitions after a generator in the same line)
|
||||
esid: prod-FieldDefinition
|
||||
features: [computed-property-names, generators, class, class-fields-public]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
ClassElement:
|
||||
...
|
||||
FieldDefinition ;
|
||||
static FieldDefinition ;
|
||||
|
||||
FieldDefinition:
|
||||
ClassElementName Initializer_opt
|
||||
|
||||
ClassElementName:
|
||||
PropertyName
|
||||
|
||||
---*/
|
||||
|
||||
|
||||
var C = class {
|
||||
*m() { return 42; } static ["a"] = 42; ["a"] = 39;
|
||||
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
verifyProperty(C, "a", {
|
||||
value: 42,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
verifyProperty(c, "a", {
|
||||
value: 39,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
@ -1,70 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-fields/static-computed-symbol-names.case
|
||||
// - src/class-fields/productions/cls-expr-after-same-line-gen.template
|
||||
/*---
|
||||
description: Static computed property symbol names (field definitions after a generator in the same line)
|
||||
esid: prod-FieldDefinition
|
||||
features: [Symbol, computed-property-names, generators, class, class-fields-public]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
ClassElement:
|
||||
...
|
||||
FieldDefinition ;
|
||||
|
||||
FieldDefinition:
|
||||
ClassElementName Initializer_opt
|
||||
|
||||
ClassElementName:
|
||||
PropertyName
|
||||
|
||||
---*/
|
||||
var x = Symbol();
|
||||
var y = Symbol();
|
||||
|
||||
|
||||
|
||||
var C = class {
|
||||
*m() { return 42; } static [x]; static [y] = 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, x), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, x), false);
|
||||
|
||||
verifyProperty(C, x, {
|
||||
value: undefined,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, y), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, y), false);
|
||||
|
||||
verifyProperty(C, y, {
|
||||
value: 42,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "x"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "x"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "x"), false);
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "y"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "y"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "y"), false);
|
@ -1,73 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-fields/static-literal-names.case
|
||||
// - src/class-fields/productions/cls-expr-after-same-line-gen.template
|
||||
/*---
|
||||
description: Static literal property names (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
|
||||
|
||||
---*/
|
||||
const fn = function() {}
|
||||
|
||||
|
||||
|
||||
var C = class {
|
||||
*m() { return 42; } static a; b = 42;
|
||||
static c = fn;
|
||||
|
||||
}
|
||||
|
||||
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
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "c"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "c"), false);
|
||||
|
||||
verifyProperty(C, "c", {
|
||||
value: fn,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
@ -1,66 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-fields/static-private-names.case
|
||||
// - src/class-fields/productions/cls-expr-after-same-line-gen.template
|
||||
/*---
|
||||
description: literal private names (field definitions after a generator in the same line)
|
||||
esid: prod-FieldDefinition
|
||||
features: [class-fields-private, generators, class, class-fields-public]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
ClassElement:
|
||||
...
|
||||
static FieldDefinition ;
|
||||
|
||||
FieldDefinition:
|
||||
ClassElementName Initializer_opt
|
||||
|
||||
ClassElementName:
|
||||
PrivateName
|
||||
|
||||
PrivateName:
|
||||
#IdentifierName
|
||||
|
||||
---*/
|
||||
|
||||
|
||||
var C = class {
|
||||
*m() { return 42; } static #x; static #y;
|
||||
static x() {
|
||||
this.#x = 42;
|
||||
return this.#x;
|
||||
}
|
||||
static y() {
|
||||
this.#y = 43;
|
||||
return this.#y;
|
||||
}
|
||||
}
|
||||
|
||||
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,
|
||||
});
|
||||
|
||||
// Test the private fields do not appear as properties before set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1");
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2");
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3");
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4");
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5");
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6");
|
||||
|
||||
// Test if private fields can be sucessfully accessed and set to value
|
||||
assert.sameValue(C.x(), 42, "test 7");
|
||||
assert.sameValue(C.y(), 43, "test 8");
|
||||
|
||||
// Test the private fields do not appear as properties before after set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9");
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10");
|
@ -24,7 +24,7 @@ var x = "b";
|
||||
|
||||
|
||||
var C = class {
|
||||
m() { return 42; } static ["a"] = 39; [x] = 42; [10] = "meep"; ["not initialized"];
|
||||
m() { return 42; } [x] = 42; [10] = "meep"; ["not initialized"];
|
||||
|
||||
}
|
||||
|
||||
@ -40,16 +40,6 @@ verifyProperty(C.prototype, "m", {
|
||||
writable: true,
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "a"), false);
|
||||
|
||||
verifyProperty(C, "a", {
|
||||
value: 39,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "b"), false);
|
||||
|
||||
|
@ -1,56 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-fields/static-computed-names.case
|
||||
// - src/class-fields/productions/cls-expr-after-same-line-method.template
|
||||
/*---
|
||||
description: Static Computed property names (field definitions after a method in the same line)
|
||||
esid: prod-FieldDefinition
|
||||
features: [computed-property-names, class, class-fields-public]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
ClassElement:
|
||||
...
|
||||
FieldDefinition ;
|
||||
static FieldDefinition ;
|
||||
|
||||
FieldDefinition:
|
||||
ClassElementName Initializer_opt
|
||||
|
||||
ClassElementName:
|
||||
PropertyName
|
||||
|
||||
---*/
|
||||
|
||||
|
||||
var C = class {
|
||||
m() { return 42; } static ["a"] = 42; ["a"] = 39;
|
||||
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
verifyProperty(C, "a", {
|
||||
value: 42,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
verifyProperty(c, "a", {
|
||||
value: 39,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
@ -1,70 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-fields/static-computed-symbol-names.case
|
||||
// - src/class-fields/productions/cls-expr-after-same-line-method.template
|
||||
/*---
|
||||
description: Static computed property symbol names (field definitions after a method in the same line)
|
||||
esid: prod-FieldDefinition
|
||||
features: [Symbol, computed-property-names, class, class-fields-public]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
ClassElement:
|
||||
...
|
||||
FieldDefinition ;
|
||||
|
||||
FieldDefinition:
|
||||
ClassElementName Initializer_opt
|
||||
|
||||
ClassElementName:
|
||||
PropertyName
|
||||
|
||||
---*/
|
||||
var x = Symbol();
|
||||
var y = Symbol();
|
||||
|
||||
|
||||
|
||||
var C = class {
|
||||
m() { return 42; } static [x]; static [y] = 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, x), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, x), false);
|
||||
|
||||
verifyProperty(C, x, {
|
||||
value: undefined,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, y), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, y), false);
|
||||
|
||||
verifyProperty(C, y, {
|
||||
value: 42,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "x"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "x"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "x"), false);
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "y"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "y"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "y"), false);
|
@ -1,73 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-fields/static-literal-names.case
|
||||
// - src/class-fields/productions/cls-expr-after-same-line-method.template
|
||||
/*---
|
||||
description: Static literal property names (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
|
||||
|
||||
---*/
|
||||
const fn = function() {}
|
||||
|
||||
|
||||
|
||||
var C = class {
|
||||
m() { return 42; } static a; b = 42;
|
||||
static c = fn;
|
||||
|
||||
}
|
||||
|
||||
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
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "c"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "c"), false);
|
||||
|
||||
verifyProperty(C, "c", {
|
||||
value: fn,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
@ -1,66 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-fields/static-private-names.case
|
||||
// - src/class-fields/productions/cls-expr-after-same-line-method.template
|
||||
/*---
|
||||
description: literal private names (field definitions after a method in the same line)
|
||||
esid: prod-FieldDefinition
|
||||
features: [class-fields-private, class, class-fields-public]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
ClassElement:
|
||||
...
|
||||
static FieldDefinition ;
|
||||
|
||||
FieldDefinition:
|
||||
ClassElementName Initializer_opt
|
||||
|
||||
ClassElementName:
|
||||
PrivateName
|
||||
|
||||
PrivateName:
|
||||
#IdentifierName
|
||||
|
||||
---*/
|
||||
|
||||
|
||||
var C = class {
|
||||
m() { return 42; } static #x; static #y;
|
||||
static x() {
|
||||
this.#x = 42;
|
||||
return this.#x;
|
||||
}
|
||||
static y() {
|
||||
this.#y = 43;
|
||||
return this.#y;
|
||||
}
|
||||
}
|
||||
|
||||
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,
|
||||
});
|
||||
|
||||
// Test the private fields do not appear as properties before set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1");
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2");
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3");
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4");
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5");
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6");
|
||||
|
||||
// Test if private fields can be sucessfully accessed and set to value
|
||||
assert.sameValue(C.x(), 42, "test 7");
|
||||
assert.sameValue(C.y(), 43, "test 8");
|
||||
|
||||
// Test the private fields do not appear as properties before after set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9");
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10");
|
@ -24,7 +24,7 @@ var x = "b";
|
||||
|
||||
|
||||
var C = class {
|
||||
static async *m() { return 42; } static ["a"] = 39; [x] = 42; [10] = "meep"; ["not initialized"];
|
||||
static async *m() { return 42; } [x] = 42; [10] = "meep"; ["not initialized"];
|
||||
|
||||
}
|
||||
|
||||
@ -39,16 +39,6 @@ verifyProperty(C, "m", {
|
||||
writable: true,
|
||||
}, {restore: true});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "a"), false);
|
||||
|
||||
verifyProperty(C, "a", {
|
||||
value: 39,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "b"), false);
|
||||
|
||||
|
@ -1,60 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-fields/static-computed-names.case
|
||||
// - src/class-fields/productions/cls-expr-after-same-line-static-async-gen.template
|
||||
/*---
|
||||
description: Static Computed property names (field definitions after a static async generator in the same line)
|
||||
esid: prod-FieldDefinition
|
||||
features: [computed-property-names, class, class-fields-public, async-iteration]
|
||||
flags: [generated, async]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
ClassElement:
|
||||
...
|
||||
FieldDefinition ;
|
||||
static FieldDefinition ;
|
||||
|
||||
FieldDefinition:
|
||||
ClassElementName Initializer_opt
|
||||
|
||||
ClassElementName:
|
||||
PropertyName
|
||||
|
||||
---*/
|
||||
|
||||
|
||||
var C = class {
|
||||
static async *m() { return 42; } static ["a"] = 42; ["a"] = 39;
|
||||
|
||||
}
|
||||
|
||||
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});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false);
|
||||
|
||||
verifyProperty(C, "a", {
|
||||
value: 42,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
verifyProperty(c, "a", {
|
||||
value: 39,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
C.m().next().then(function(v) {
|
||||
assert.sameValue(v.value, 42);
|
||||
assert.sameValue(v.done, true);
|
||||
}, $DONE).then($DONE, $DONE);
|
@ -1,74 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-fields/static-computed-symbol-names.case
|
||||
// - src/class-fields/productions/cls-expr-after-same-line-static-async-gen.template
|
||||
/*---
|
||||
description: Static computed property symbol names (field definitions after a static async generator in the same line)
|
||||
esid: prod-FieldDefinition
|
||||
features: [Symbol, computed-property-names, class, class-fields-public, async-iteration]
|
||||
flags: [generated, async]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
ClassElement:
|
||||
...
|
||||
FieldDefinition ;
|
||||
|
||||
FieldDefinition:
|
||||
ClassElementName Initializer_opt
|
||||
|
||||
ClassElementName:
|
||||
PropertyName
|
||||
|
||||
---*/
|
||||
var x = Symbol();
|
||||
var y = Symbol();
|
||||
|
||||
|
||||
|
||||
var C = class {
|
||||
static async *m() { return 42; } static [x]; static [y] = 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});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, x), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, x), false);
|
||||
|
||||
verifyProperty(C, x, {
|
||||
value: undefined,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, y), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, y), false);
|
||||
|
||||
verifyProperty(C, y, {
|
||||
value: 42,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "x"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "x"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "x"), false);
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "y"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "y"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "y"), false);
|
||||
|
||||
C.m().next().then(function(v) {
|
||||
assert.sameValue(v.value, 42);
|
||||
assert.sameValue(v.done, true);
|
||||
}, $DONE).then($DONE, $DONE);
|
@ -1,77 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-fields/static-literal-names.case
|
||||
// - src/class-fields/productions/cls-expr-after-same-line-static-async-gen.template
|
||||
/*---
|
||||
description: Static literal property names (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
|
||||
|
||||
---*/
|
||||
const fn = function() {}
|
||||
|
||||
|
||||
|
||||
var C = class {
|
||||
static async *m() { return 42; } static a; b = 42;
|
||||
static c = fn;
|
||||
|
||||
}
|
||||
|
||||
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});
|
||||
|
||||
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
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "c"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "c"), false);
|
||||
|
||||
verifyProperty(C, "c", {
|
||||
value: fn,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
|
||||
C.m().next().then(function(v) {
|
||||
assert.sameValue(v.value, 42);
|
||||
assert.sameValue(v.done, true);
|
||||
}, $DONE).then($DONE, $DONE);
|
@ -1,70 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-fields/static-private-names.case
|
||||
// - src/class-fields/productions/cls-expr-after-same-line-static-async-gen.template
|
||||
/*---
|
||||
description: literal private names (field definitions after a static async generator in the same line)
|
||||
esid: prod-FieldDefinition
|
||||
features: [class-fields-private, class, class-fields-public, async-iteration]
|
||||
flags: [generated, async]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
ClassElement:
|
||||
...
|
||||
static FieldDefinition ;
|
||||
|
||||
FieldDefinition:
|
||||
ClassElementName Initializer_opt
|
||||
|
||||
ClassElementName:
|
||||
PrivateName
|
||||
|
||||
PrivateName:
|
||||
#IdentifierName
|
||||
|
||||
---*/
|
||||
|
||||
|
||||
var C = class {
|
||||
static async *m() { return 42; } static #x; static #y;
|
||||
static x() {
|
||||
this.#x = 42;
|
||||
return this.#x;
|
||||
}
|
||||
static y() {
|
||||
this.#y = 43;
|
||||
return this.#y;
|
||||
}
|
||||
}
|
||||
|
||||
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});
|
||||
|
||||
// Test the private fields do not appear as properties before set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1");
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2");
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3");
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4");
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5");
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6");
|
||||
|
||||
// Test if private fields can be sucessfully accessed and set to value
|
||||
assert.sameValue(C.x(), 42, "test 7");
|
||||
assert.sameValue(C.y(), 43, "test 8");
|
||||
|
||||
// Test the private fields do not appear as properties before after set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9");
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10");
|
||||
|
||||
C.m().next().then(function(v) {
|
||||
assert.sameValue(v.value, 42);
|
||||
assert.sameValue(v.done, true);
|
||||
}, $DONE).then($DONE, $DONE);
|
@ -24,7 +24,7 @@ var x = "b";
|
||||
|
||||
|
||||
var C = class {
|
||||
static async m() { return 42; } static ["a"] = 39; [x] = 42; [10] = "meep"; ["not initialized"];
|
||||
static async m() { return 42; } [x] = 42; [10] = "meep"; ["not initialized"];
|
||||
|
||||
}
|
||||
|
||||
@ -39,16 +39,6 @@ verifyProperty(C, "m", {
|
||||
writable: true,
|
||||
}, {restore: true});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "a"), false);
|
||||
|
||||
verifyProperty(C, "a", {
|
||||
value: 39,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "b"), false);
|
||||
|
||||
|
@ -1,59 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-fields/static-computed-names.case
|
||||
// - src/class-fields/productions/cls-expr-after-same-line-static-async-method.template
|
||||
/*---
|
||||
description: Static Computed property names (field definitions after a static async method in the same line)
|
||||
esid: prod-FieldDefinition
|
||||
features: [computed-property-names, class, class-fields-public, async-functions]
|
||||
flags: [generated, async]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
ClassElement:
|
||||
...
|
||||
FieldDefinition ;
|
||||
static FieldDefinition ;
|
||||
|
||||
FieldDefinition:
|
||||
ClassElementName Initializer_opt
|
||||
|
||||
ClassElementName:
|
||||
PropertyName
|
||||
|
||||
---*/
|
||||
|
||||
|
||||
var C = class {
|
||||
static async m() { return 42; } static ["a"] = 42; ["a"] = 39;
|
||||
|
||||
}
|
||||
|
||||
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});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false);
|
||||
|
||||
verifyProperty(C, "a", {
|
||||
value: 42,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
verifyProperty(c, "a", {
|
||||
value: 39,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
C.m().then(function(v) {
|
||||
assert.sameValue(v, 42);
|
||||
}, $DONE).then($DONE, $DONE);
|
@ -1,73 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-fields/static-computed-symbol-names.case
|
||||
// - src/class-fields/productions/cls-expr-after-same-line-static-async-method.template
|
||||
/*---
|
||||
description: Static computed property symbol names (field definitions after a static async method in the same line)
|
||||
esid: prod-FieldDefinition
|
||||
features: [Symbol, computed-property-names, class, class-fields-public, async-functions]
|
||||
flags: [generated, async]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
ClassElement:
|
||||
...
|
||||
FieldDefinition ;
|
||||
|
||||
FieldDefinition:
|
||||
ClassElementName Initializer_opt
|
||||
|
||||
ClassElementName:
|
||||
PropertyName
|
||||
|
||||
---*/
|
||||
var x = Symbol();
|
||||
var y = Symbol();
|
||||
|
||||
|
||||
|
||||
var C = class {
|
||||
static async m() { return 42; } static [x]; static [y] = 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});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, x), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, x), false);
|
||||
|
||||
verifyProperty(C, x, {
|
||||
value: undefined,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, y), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, y), false);
|
||||
|
||||
verifyProperty(C, y, {
|
||||
value: 42,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "x"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "x"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "x"), false);
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "y"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "y"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "y"), false);
|
||||
|
||||
C.m().then(function(v) {
|
||||
assert.sameValue(v, 42);
|
||||
}, $DONE).then($DONE, $DONE);
|
@ -1,76 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-fields/static-literal-names.case
|
||||
// - src/class-fields/productions/cls-expr-after-same-line-static-async-method.template
|
||||
/*---
|
||||
description: Static literal property names (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
|
||||
|
||||
---*/
|
||||
const fn = function() {}
|
||||
|
||||
|
||||
|
||||
var C = class {
|
||||
static async m() { return 42; } static a; b = 42;
|
||||
static c = fn;
|
||||
|
||||
}
|
||||
|
||||
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});
|
||||
|
||||
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
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "c"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "c"), false);
|
||||
|
||||
verifyProperty(C, "c", {
|
||||
value: fn,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
|
||||
C.m().then(function(v) {
|
||||
assert.sameValue(v, 42);
|
||||
}, $DONE).then($DONE, $DONE);
|
@ -1,69 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-fields/static-private-names.case
|
||||
// - src/class-fields/productions/cls-expr-after-same-line-static-async-method.template
|
||||
/*---
|
||||
description: literal private names (field definitions after a static async method in the same line)
|
||||
esid: prod-FieldDefinition
|
||||
features: [class-fields-private, class, class-fields-public, async-functions]
|
||||
flags: [generated, async]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
ClassElement:
|
||||
...
|
||||
static FieldDefinition ;
|
||||
|
||||
FieldDefinition:
|
||||
ClassElementName Initializer_opt
|
||||
|
||||
ClassElementName:
|
||||
PrivateName
|
||||
|
||||
PrivateName:
|
||||
#IdentifierName
|
||||
|
||||
---*/
|
||||
|
||||
|
||||
var C = class {
|
||||
static async m() { return 42; } static #x; static #y;
|
||||
static x() {
|
||||
this.#x = 42;
|
||||
return this.#x;
|
||||
}
|
||||
static y() {
|
||||
this.#y = 43;
|
||||
return this.#y;
|
||||
}
|
||||
}
|
||||
|
||||
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});
|
||||
|
||||
// Test the private fields do not appear as properties before set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1");
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2");
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3");
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4");
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5");
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6");
|
||||
|
||||
// Test if private fields can be sucessfully accessed and set to value
|
||||
assert.sameValue(C.x(), 42, "test 7");
|
||||
assert.sameValue(C.y(), 43, "test 8");
|
||||
|
||||
// Test the private fields do not appear as properties before after set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9");
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10");
|
||||
|
||||
C.m().then(function(v) {
|
||||
assert.sameValue(v, 42);
|
||||
}, $DONE).then($DONE, $DONE);
|
@ -24,7 +24,7 @@ var x = "b";
|
||||
|
||||
|
||||
var C = class {
|
||||
static *m() { return 42; } static ["a"] = 39; [x] = 42; [10] = "meep"; ["not initialized"];
|
||||
static *m() { return 42; } [x] = 42; [10] = "meep"; ["not initialized"];
|
||||
|
||||
}
|
||||
|
||||
@ -40,16 +40,6 @@ verifyProperty(C, "m", {
|
||||
writable: true,
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "a"), false);
|
||||
|
||||
verifyProperty(C, "a", {
|
||||
value: 39,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "b"), false);
|
||||
|
||||
|
@ -1,56 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-fields/static-computed-names.case
|
||||
// - src/class-fields/productions/cls-expr-after-same-line-static-gen.template
|
||||
/*---
|
||||
description: Static Computed property names (field definitions after a static generator in the same line)
|
||||
esid: prod-FieldDefinition
|
||||
features: [computed-property-names, generators, class, class-fields-public]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
ClassElement:
|
||||
...
|
||||
FieldDefinition ;
|
||||
static FieldDefinition ;
|
||||
|
||||
FieldDefinition:
|
||||
ClassElementName Initializer_opt
|
||||
|
||||
ClassElementName:
|
||||
PropertyName
|
||||
|
||||
---*/
|
||||
|
||||
|
||||
var C = class {
|
||||
static *m() { return 42; } static ["a"] = 42; ["a"] = 39;
|
||||
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
verifyProperty(C, "a", {
|
||||
value: 42,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
verifyProperty(c, "a", {
|
||||
value: 39,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
@ -1,70 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-fields/static-computed-symbol-names.case
|
||||
// - src/class-fields/productions/cls-expr-after-same-line-static-gen.template
|
||||
/*---
|
||||
description: Static computed property symbol names (field definitions after a static generator in the same line)
|
||||
esid: prod-FieldDefinition
|
||||
features: [Symbol, computed-property-names, generators, class, class-fields-public]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
ClassElement:
|
||||
...
|
||||
FieldDefinition ;
|
||||
|
||||
FieldDefinition:
|
||||
ClassElementName Initializer_opt
|
||||
|
||||
ClassElementName:
|
||||
PropertyName
|
||||
|
||||
---*/
|
||||
var x = Symbol();
|
||||
var y = Symbol();
|
||||
|
||||
|
||||
|
||||
var C = class {
|
||||
static *m() { return 42; } static [x]; static [y] = 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, x), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, x), false);
|
||||
|
||||
verifyProperty(C, x, {
|
||||
value: undefined,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, y), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, y), false);
|
||||
|
||||
verifyProperty(C, y, {
|
||||
value: 42,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "x"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "x"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "x"), false);
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "y"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "y"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "y"), false);
|
@ -1,73 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-fields/static-literal-names.case
|
||||
// - src/class-fields/productions/cls-expr-after-same-line-static-gen.template
|
||||
/*---
|
||||
description: Static literal property names (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
|
||||
|
||||
---*/
|
||||
const fn = function() {}
|
||||
|
||||
|
||||
|
||||
var C = class {
|
||||
static *m() { return 42; } static a; b = 42;
|
||||
static c = fn;
|
||||
|
||||
}
|
||||
|
||||
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
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "c"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "c"), false);
|
||||
|
||||
verifyProperty(C, "c", {
|
||||
value: fn,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
@ -1,66 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-fields/static-private-names.case
|
||||
// - src/class-fields/productions/cls-expr-after-same-line-static-gen.template
|
||||
/*---
|
||||
description: literal private names (field definitions after a static generator in the same line)
|
||||
esid: prod-FieldDefinition
|
||||
features: [class-fields-private, generators, class, class-fields-public]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
ClassElement:
|
||||
...
|
||||
static FieldDefinition ;
|
||||
|
||||
FieldDefinition:
|
||||
ClassElementName Initializer_opt
|
||||
|
||||
ClassElementName:
|
||||
PrivateName
|
||||
|
||||
PrivateName:
|
||||
#IdentifierName
|
||||
|
||||
---*/
|
||||
|
||||
|
||||
var C = class {
|
||||
static *m() { return 42; } static #x; static #y;
|
||||
static x() {
|
||||
this.#x = 42;
|
||||
return this.#x;
|
||||
}
|
||||
static y() {
|
||||
this.#y = 43;
|
||||
return this.#y;
|
||||
}
|
||||
}
|
||||
|
||||
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,
|
||||
});
|
||||
|
||||
// Test the private fields do not appear as properties before set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1");
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2");
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3");
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4");
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5");
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6");
|
||||
|
||||
// Test if private fields can be sucessfully accessed and set to value
|
||||
assert.sameValue(C.x(), 42, "test 7");
|
||||
assert.sameValue(C.y(), 43, "test 8");
|
||||
|
||||
// Test the private fields do not appear as properties before after set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9");
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10");
|
@ -24,7 +24,7 @@ var x = "b";
|
||||
|
||||
|
||||
var C = class {
|
||||
static m() { return 42; } static ["a"] = 39; [x] = 42; [10] = "meep"; ["not initialized"];
|
||||
static m() { return 42; } [x] = 42; [10] = "meep"; ["not initialized"];
|
||||
|
||||
}
|
||||
|
||||
@ -40,16 +40,6 @@ verifyProperty(C, "m", {
|
||||
writable: true,
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "a"), false);
|
||||
|
||||
verifyProperty(C, "a", {
|
||||
value: 39,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "b"), false);
|
||||
|
||||
|
@ -1,56 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-fields/static-computed-names.case
|
||||
// - src/class-fields/productions/cls-expr-after-same-line-static-method.template
|
||||
/*---
|
||||
description: Static Computed property names (field definitions after a static method in the same line)
|
||||
esid: prod-FieldDefinition
|
||||
features: [computed-property-names, class, class-fields-public]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
ClassElement:
|
||||
...
|
||||
FieldDefinition ;
|
||||
static FieldDefinition ;
|
||||
|
||||
FieldDefinition:
|
||||
ClassElementName Initializer_opt
|
||||
|
||||
ClassElementName:
|
||||
PropertyName
|
||||
|
||||
---*/
|
||||
|
||||
|
||||
var C = class {
|
||||
static m() { return 42; } static ["a"] = 42; ["a"] = 39;
|
||||
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
verifyProperty(C, "a", {
|
||||
value: 42,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
verifyProperty(c, "a", {
|
||||
value: 39,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
@ -1,70 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-fields/static-computed-symbol-names.case
|
||||
// - src/class-fields/productions/cls-expr-after-same-line-static-method.template
|
||||
/*---
|
||||
description: Static computed property symbol names (field definitions after a static method in the same line)
|
||||
esid: prod-FieldDefinition
|
||||
features: [Symbol, computed-property-names, class, class-fields-public]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
ClassElement:
|
||||
...
|
||||
FieldDefinition ;
|
||||
|
||||
FieldDefinition:
|
||||
ClassElementName Initializer_opt
|
||||
|
||||
ClassElementName:
|
||||
PropertyName
|
||||
|
||||
---*/
|
||||
var x = Symbol();
|
||||
var y = Symbol();
|
||||
|
||||
|
||||
|
||||
var C = class {
|
||||
static m() { return 42; } static [x]; static [y] = 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, x), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, x), false);
|
||||
|
||||
verifyProperty(C, x, {
|
||||
value: undefined,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, y), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, y), false);
|
||||
|
||||
verifyProperty(C, y, {
|
||||
value: 42,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "x"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "x"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "x"), false);
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "y"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "y"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "y"), false);
|
@ -1,73 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-fields/static-literal-names.case
|
||||
// - src/class-fields/productions/cls-expr-after-same-line-static-method.template
|
||||
/*---
|
||||
description: Static literal property names (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
|
||||
|
||||
---*/
|
||||
const fn = function() {}
|
||||
|
||||
|
||||
|
||||
var C = class {
|
||||
static m() { return 42; } static a; b = 42;
|
||||
static c = fn;
|
||||
|
||||
}
|
||||
|
||||
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
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "c"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "c"), false);
|
||||
|
||||
verifyProperty(C, "c", {
|
||||
value: fn,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
@ -1,66 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-fields/static-private-names.case
|
||||
// - src/class-fields/productions/cls-expr-after-same-line-static-method.template
|
||||
/*---
|
||||
description: literal private names (field definitions after a static method in the same line)
|
||||
esid: prod-FieldDefinition
|
||||
features: [class-fields-private, class, class-fields-public]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
ClassElement:
|
||||
...
|
||||
static FieldDefinition ;
|
||||
|
||||
FieldDefinition:
|
||||
ClassElementName Initializer_opt
|
||||
|
||||
ClassElementName:
|
||||
PrivateName
|
||||
|
||||
PrivateName:
|
||||
#IdentifierName
|
||||
|
||||
---*/
|
||||
|
||||
|
||||
var C = class {
|
||||
static m() { return 42; } static #x; static #y;
|
||||
static x() {
|
||||
this.#x = 42;
|
||||
return this.#x;
|
||||
}
|
||||
static y() {
|
||||
this.#y = 43;
|
||||
return this.#y;
|
||||
}
|
||||
}
|
||||
|
||||
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,
|
||||
});
|
||||
|
||||
// Test the private fields do not appear as properties before set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1");
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2");
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3");
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4");
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5");
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6");
|
||||
|
||||
// Test if private fields can be sucessfully accessed and set to value
|
||||
assert.sameValue(C.x(), 42, "test 7");
|
||||
assert.sameValue(C.y(), 43, "test 8");
|
||||
|
||||
// Test the private fields do not appear as properties before after set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9");
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10");
|
@ -24,9 +24,6 @@ info: |
|
||||
|
||||
Runtime Semantics: ClassElementEvaluation
|
||||
|
||||
ClassElement: static FieldDefinition;
|
||||
Return ClassFieldDefinitionEvaluation of FieldDefinition with parameter true and object.
|
||||
|
||||
ClassElement: FieldDefinition;
|
||||
Return ClassFieldDefinitionEvaluation of FieldDefinition with parameter false and object.
|
||||
|
||||
|
@ -24,9 +24,6 @@ info: |
|
||||
|
||||
Runtime Semantics: ClassElementEvaluation
|
||||
|
||||
ClassElement: static FieldDefinition;
|
||||
Return ClassFieldDefinitionEvaluation of FieldDefinition with parameter true and object.
|
||||
|
||||
ClassElement: FieldDefinition;
|
||||
Return ClassFieldDefinitionEvaluation of FieldDefinition with parameter false and object.
|
||||
|
||||
|
@ -1,33 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-fields/static-propname-constructor.case
|
||||
// - src/class-fields/propname-error-static/cls-expr-static-variable-name.template
|
||||
/*---
|
||||
description: static class field forbid PropName 'constructor' (no early error -- PropName of ComputedPropertyName not forbidden value)
|
||||
esid: sec-class-definitions-static-semantics-early-errors
|
||||
features: [class, class-fields-public]
|
||||
flags: [generated]
|
||||
info: |
|
||||
Static Semantics: PropName
|
||||
...
|
||||
ComputedPropertyName : [ AssignmentExpression ]
|
||||
Return empty.
|
||||
|
||||
|
||||
// This test file tests the following early error:
|
||||
Static Semantics: Early Errors
|
||||
|
||||
ClassElement : staticFieldDefinition;
|
||||
It is a Syntax Error if PropName of FieldDefinition is "prototype" or "constructor".
|
||||
|
||||
---*/
|
||||
|
||||
|
||||
var constructor = 'foo';
|
||||
var C = class {
|
||||
static [constructor];
|
||||
};
|
||||
|
||||
assert.sameValue(C.hasOwnProperty("foo"), true);
|
||||
|
||||
var c = new C();
|
||||
assert.sameValue(c.hasOwnProperty("foo"), false);
|
@ -1,33 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-fields/static-propname-prototype.case
|
||||
// - src/class-fields/propname-error-static/cls-expr-static-variable-name.template
|
||||
/*---
|
||||
description: static class fields forbid PropName 'prototype' (no early error -- PropName of ComputedPropertyName not forbidden value)
|
||||
esid: sec-class-definitions-static-semantics-early-errors
|
||||
features: [class, class-fields-public]
|
||||
flags: [generated]
|
||||
info: |
|
||||
Static Semantics: PropName
|
||||
...
|
||||
ComputedPropertyName : [ AssignmentExpression ]
|
||||
Return empty.
|
||||
|
||||
|
||||
// This test file tests the following early error:
|
||||
Static Semantics: Early Errors
|
||||
|
||||
ClassElement : staticFieldDefinition;
|
||||
It is a Syntax Error if PropName of FieldDefinition is "prototype" or "constructor".
|
||||
|
||||
---*/
|
||||
|
||||
|
||||
var prototype = 'foo';
|
||||
var C = class {
|
||||
static [prototype];
|
||||
};
|
||||
|
||||
assert.sameValue(C.hasOwnProperty("foo"), true);
|
||||
|
||||
var c = new C();
|
||||
assert.sameValue(c.hasOwnProperty("foo"), false);
|
@ -23,9 +23,6 @@ info: |
|
||||
|
||||
Runtime Semantics: ClassElementEvaluation
|
||||
|
||||
ClassElement: static FieldDefinition;
|
||||
Return ClassFieldDefinitionEvaluation of FieldDefinition with parameter true and object.
|
||||
|
||||
ClassElement: FieldDefinition;
|
||||
Return ClassFieldDefinitionEvaluation of FieldDefinition with parameter false and object.
|
||||
|
||||
|
@ -23,9 +23,6 @@ info: |
|
||||
|
||||
Runtime Semantics: ClassElementEvaluation
|
||||
|
||||
ClassElement: static FieldDefinition;
|
||||
Return ClassFieldDefinitionEvaluation of FieldDefinition with parameter true and object.
|
||||
|
||||
ClassElement: FieldDefinition;
|
||||
Return ClassFieldDefinitionEvaluation of FieldDefinition with parameter false and object.
|
||||
|
||||
|
@ -23,9 +23,6 @@ info: |
|
||||
|
||||
Runtime Semantics: ClassElementEvaluation
|
||||
|
||||
ClassElement: static FieldDefinition;
|
||||
Return ClassFieldDefinitionEvaluation of FieldDefinition with parameter true and object.
|
||||
|
||||
ClassElement: FieldDefinition;
|
||||
Return ClassFieldDefinitionEvaluation of FieldDefinition with parameter false and object.
|
||||
|
||||
|
@ -23,9 +23,6 @@ info: |
|
||||
|
||||
Runtime Semantics: ClassElementEvaluation
|
||||
|
||||
ClassElement: static FieldDefinition;
|
||||
Return ClassFieldDefinitionEvaluation of FieldDefinition with parameter true and object.
|
||||
|
||||
ClassElement: FieldDefinition;
|
||||
Return ClassFieldDefinitionEvaluation of FieldDefinition with parameter false and object.
|
||||
|
||||
|
@ -28,57 +28,41 @@ info: |
|
||||
...
|
||||
|
||||
---*/
|
||||
var x = 0;
|
||||
var x = 1;
|
||||
|
||||
|
||||
var C = class {
|
||||
static [x++] = x++;
|
||||
[x++] = x++;
|
||||
static [x++] = x++;
|
||||
[x++] = x++;
|
||||
}
|
||||
|
||||
var c1 = new C();
|
||||
var c2 = new C();
|
||||
|
||||
verifyProperty(C, "0", {
|
||||
verifyProperty(c1, "1", {
|
||||
value: 3,
|
||||
enumerable: true,
|
||||
configurable: true,
|
||||
writable: true,
|
||||
});
|
||||
|
||||
verifyProperty(c1, "2", {
|
||||
value: 4,
|
||||
enumerable: true,
|
||||
configurable: true,
|
||||
writable: true,
|
||||
});
|
||||
|
||||
verifyProperty(C, "2", {
|
||||
verifyProperty(c2, "1", {
|
||||
value: 5,
|
||||
enumerable: true,
|
||||
configurable: true,
|
||||
writable: true,
|
||||
});
|
||||
|
||||
verifyProperty(c1, "1", {
|
||||
verifyProperty(c2, "2", {
|
||||
value: 6,
|
||||
enumerable: true,
|
||||
configurable: true,
|
||||
writable: true,
|
||||
});
|
||||
|
||||
verifyProperty(c1, "3", {
|
||||
value: 7,
|
||||
enumerable: true,
|
||||
configurable: true,
|
||||
writable: true,
|
||||
});
|
||||
|
||||
verifyProperty(c2, "1", {
|
||||
value: 8,
|
||||
enumerable: true,
|
||||
configurable: true,
|
||||
writable: true,
|
||||
});
|
||||
|
||||
verifyProperty(c2, "3", {
|
||||
value: 9,
|
||||
enumerable: true,
|
||||
configurable: true,
|
||||
writable: true,
|
||||
});
|
||||
|
@ -1,31 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-fields/static-propname-constructor.case
|
||||
// - src/class-fields/propname-error-static/cls-expr-static-literal-name.template
|
||||
/*---
|
||||
description: static class field forbid PropName 'constructor' (early error -- PropName of IdentifierName is forbidden)
|
||||
esid: sec-class-definitions-static-semantics-early-errors
|
||||
features: [class, class-fields-public]
|
||||
flags: [generated]
|
||||
negative:
|
||||
phase: early
|
||||
type: SyntaxError
|
||||
info: |
|
||||
Static Semantics: PropName
|
||||
LiteralPropertyName : IdentifierName
|
||||
Return StringValue of IdentifierName.
|
||||
|
||||
|
||||
// This test file tests the following early error:
|
||||
Static Semantics: Early Errors
|
||||
|
||||
ClassElement : staticFieldDefinition;
|
||||
It is a Syntax Error if PropName of FieldDefinition is "prototype" or "constructor".
|
||||
|
||||
---*/
|
||||
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
var C = class {
|
||||
static constructor;
|
||||
};
|
@ -1,31 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-fields/static-propname-prototype.case
|
||||
// - src/class-fields/propname-error-static/cls-expr-static-literal-name.template
|
||||
/*---
|
||||
description: static class fields forbid PropName 'prototype' (early error -- PropName of IdentifierName is forbidden)
|
||||
esid: sec-class-definitions-static-semantics-early-errors
|
||||
features: [class, class-fields-public]
|
||||
flags: [generated]
|
||||
negative:
|
||||
phase: early
|
||||
type: SyntaxError
|
||||
info: |
|
||||
Static Semantics: PropName
|
||||
LiteralPropertyName : IdentifierName
|
||||
Return StringValue of IdentifierName.
|
||||
|
||||
|
||||
// This test file tests the following early error:
|
||||
Static Semantics: Early Errors
|
||||
|
||||
ClassElement : staticFieldDefinition;
|
||||
It is a Syntax Error if PropName of FieldDefinition is "prototype" or "constructor".
|
||||
|
||||
---*/
|
||||
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
var C = class {
|
||||
static prototype;
|
||||
};
|
@ -26,7 +26,7 @@ var x = "b";
|
||||
var C = class {
|
||||
foo = "foobar";
|
||||
m() { return 42 }
|
||||
static ["a"] = 39; [x] = 42; [10] = "meep"; ["not initialized"]
|
||||
[x] = 42; [10] = "meep"; ["not initialized"]
|
||||
m2() { return 39 }
|
||||
bar = "barbaz";
|
||||
|
||||
@ -76,16 +76,6 @@ verifyProperty(c, "bar", {
|
||||
writable: true,
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "a"), false);
|
||||
|
||||
verifyProperty(C, "a", {
|
||||
value: 39,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "b"), false);
|
||||
|
||||
|
@ -1,92 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-fields/static-computed-names.case
|
||||
// - src/class-fields/productions/cls-expr-multiple-definitions.template
|
||||
/*---
|
||||
description: Static Computed property names (multiple fields definitions)
|
||||
esid: prod-FieldDefinition
|
||||
features: [computed-property-names, class, class-fields-public]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
ClassElement:
|
||||
...
|
||||
FieldDefinition ;
|
||||
static FieldDefinition ;
|
||||
|
||||
FieldDefinition:
|
||||
ClassElementName Initializer_opt
|
||||
|
||||
ClassElementName:
|
||||
PropertyName
|
||||
|
||||
---*/
|
||||
|
||||
|
||||
var C = class {
|
||||
foo = "foobar";
|
||||
m() { return 42 }
|
||||
static ["a"] = 42; ["a"] = 39
|
||||
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);
|
||||
|
||||
verifyProperty(C, "a", {
|
||||
value: 42,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
verifyProperty(c, "a", {
|
||||
value: 39,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
@ -1,106 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-fields/static-computed-symbol-names.case
|
||||
// - src/class-fields/productions/cls-expr-multiple-definitions.template
|
||||
/*---
|
||||
description: Static computed property symbol names (multiple fields definitions)
|
||||
esid: prod-FieldDefinition
|
||||
features: [Symbol, computed-property-names, class, class-fields-public]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
ClassElement:
|
||||
...
|
||||
FieldDefinition ;
|
||||
|
||||
FieldDefinition:
|
||||
ClassElementName Initializer_opt
|
||||
|
||||
ClassElementName:
|
||||
PropertyName
|
||||
|
||||
---*/
|
||||
var x = Symbol();
|
||||
var y = Symbol();
|
||||
|
||||
|
||||
|
||||
var C = class {
|
||||
foo = "foobar";
|
||||
m() { return 42 }
|
||||
static [x]; static [y] = 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, x), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, x), false);
|
||||
|
||||
verifyProperty(C, x, {
|
||||
value: undefined,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, y), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, y), false);
|
||||
|
||||
verifyProperty(C, y, {
|
||||
value: 42,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "x"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "x"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "x"), false);
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "y"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "y"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "y"), false);
|
@ -1,109 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-fields/static-literal-names.case
|
||||
// - src/class-fields/productions/cls-expr-multiple-definitions.template
|
||||
/*---
|
||||
description: Static literal property names (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
|
||||
|
||||
---*/
|
||||
const fn = function() {}
|
||||
|
||||
|
||||
|
||||
var C = class {
|
||||
foo = "foobar";
|
||||
m() { return 42 }
|
||||
static a; b = 42;
|
||||
static c = fn
|
||||
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
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "c"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "c"), false);
|
||||
|
||||
verifyProperty(C, "c", {
|
||||
value: fn,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
@ -1,102 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-fields/static-private-names.case
|
||||
// - src/class-fields/productions/cls-expr-multiple-definitions.template
|
||||
/*---
|
||||
description: literal private names (multiple fields definitions)
|
||||
esid: prod-FieldDefinition
|
||||
features: [class-fields-private, class, class-fields-public]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
ClassElement:
|
||||
...
|
||||
static FieldDefinition ;
|
||||
|
||||
FieldDefinition:
|
||||
ClassElementName Initializer_opt
|
||||
|
||||
ClassElementName:
|
||||
PrivateName
|
||||
|
||||
PrivateName:
|
||||
#IdentifierName
|
||||
|
||||
---*/
|
||||
|
||||
|
||||
var C = class {
|
||||
foo = "foobar";
|
||||
m() { return 42 }
|
||||
static #x; static #y
|
||||
m2() { return 39 }
|
||||
bar = "barbaz";
|
||||
static x() {
|
||||
this.#x = 42;
|
||||
return this.#x;
|
||||
}
|
||||
static y() {
|
||||
this.#y = 43;
|
||||
return this.#y;
|
||||
}
|
||||
}
|
||||
|
||||
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,
|
||||
});
|
||||
|
||||
// Test the private fields do not appear as properties before set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1");
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2");
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3");
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4");
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5");
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6");
|
||||
|
||||
// Test if private fields can be sucessfully accessed and set to value
|
||||
assert.sameValue(C.x(), 42, "test 7");
|
||||
assert.sameValue(C.y(), 43, "test 8");
|
||||
|
||||
// Test the private fields do not appear as properties before after set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9");
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10");
|
@ -24,7 +24,7 @@ var x = "b";
|
||||
|
||||
|
||||
var C = class {
|
||||
static ["a"] = 39; [x] = 42; [10] = "meep"; ["not initialized"]
|
||||
[x] = 42; [10] = "meep"; ["not initialized"]
|
||||
foo = "foobar"
|
||||
bar = "barbaz";
|
||||
|
||||
@ -54,16 +54,6 @@ verifyProperty(c, "bar", {
|
||||
writable: true,
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "a"), false);
|
||||
|
||||
verifyProperty(C, "a", {
|
||||
value: 39,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "b"), false);
|
||||
|
||||
|
@ -1,70 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-fields/static-computed-names.case
|
||||
// - src/class-fields/productions/cls-expr-multiple-stacked-definitions.template
|
||||
/*---
|
||||
description: Static Computed property names (multiple stacked fields definitions through ASI)
|
||||
esid: prod-FieldDefinition
|
||||
features: [computed-property-names, class, class-fields-public]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
ClassElement:
|
||||
...
|
||||
FieldDefinition ;
|
||||
static FieldDefinition ;
|
||||
|
||||
FieldDefinition:
|
||||
ClassElementName Initializer_opt
|
||||
|
||||
ClassElementName:
|
||||
PropertyName
|
||||
|
||||
---*/
|
||||
|
||||
|
||||
var C = class {
|
||||
static ["a"] = 42; ["a"] = 39
|
||||
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);
|
||||
|
||||
verifyProperty(C, "a", {
|
||||
value: 42,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
verifyProperty(c, "a", {
|
||||
value: 39,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
@ -1,84 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-fields/static-computed-symbol-names.case
|
||||
// - src/class-fields/productions/cls-expr-multiple-stacked-definitions.template
|
||||
/*---
|
||||
description: Static computed property symbol names (multiple stacked fields definitions through ASI)
|
||||
esid: prod-FieldDefinition
|
||||
features: [Symbol, computed-property-names, class, class-fields-public]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
ClassElement:
|
||||
...
|
||||
FieldDefinition ;
|
||||
|
||||
FieldDefinition:
|
||||
ClassElementName Initializer_opt
|
||||
|
||||
ClassElementName:
|
||||
PropertyName
|
||||
|
||||
---*/
|
||||
var x = Symbol();
|
||||
var y = Symbol();
|
||||
|
||||
|
||||
|
||||
var C = class {
|
||||
static [x]; static [y] = 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, x), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, x), false);
|
||||
|
||||
verifyProperty(C, x, {
|
||||
value: undefined,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, y), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, y), false);
|
||||
|
||||
verifyProperty(C, y, {
|
||||
value: 42,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "x"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "x"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "x"), false);
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "y"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "y"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "y"), false);
|
@ -1,87 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-fields/static-literal-names.case
|
||||
// - src/class-fields/productions/cls-expr-multiple-stacked-definitions.template
|
||||
/*---
|
||||
description: Static literal property names (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
|
||||
|
||||
---*/
|
||||
const fn = function() {}
|
||||
|
||||
|
||||
|
||||
var C = class {
|
||||
static a; b = 42;
|
||||
static c = fn
|
||||
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
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "c"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "c"), false);
|
||||
|
||||
verifyProperty(C, "c", {
|
||||
value: fn,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
@ -1,80 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-fields/static-private-names.case
|
||||
// - src/class-fields/productions/cls-expr-multiple-stacked-definitions.template
|
||||
/*---
|
||||
description: literal private names (multiple stacked fields definitions through ASI)
|
||||
esid: prod-FieldDefinition
|
||||
features: [class-fields-private, class, class-fields-public]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
ClassElement:
|
||||
...
|
||||
static FieldDefinition ;
|
||||
|
||||
FieldDefinition:
|
||||
ClassElementName Initializer_opt
|
||||
|
||||
ClassElementName:
|
||||
PrivateName
|
||||
|
||||
PrivateName:
|
||||
#IdentifierName
|
||||
|
||||
---*/
|
||||
|
||||
|
||||
var C = class {
|
||||
static #x; static #y
|
||||
foo = "foobar"
|
||||
bar = "barbaz";
|
||||
static x() {
|
||||
this.#x = 42;
|
||||
return this.#x;
|
||||
}
|
||||
static y() {
|
||||
this.#y = 43;
|
||||
return this.#y;
|
||||
}
|
||||
}
|
||||
|
||||
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,
|
||||
});
|
||||
|
||||
// Test the private fields do not appear as properties before set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1");
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2");
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3");
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4");
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5");
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6");
|
||||
|
||||
// Test if private fields can be sucessfully accessed and set to value
|
||||
assert.sameValue(C.x(), 42, "test 7");
|
||||
assert.sameValue(C.y(), 43, "test 8");
|
||||
|
||||
// Test the private fields do not appear as properties before after set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9");
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10");
|
@ -24,7 +24,7 @@ var x = "b";
|
||||
|
||||
|
||||
var C = class {
|
||||
static ["a"] = 39; [x] = 42; [10] = "meep"; ["not initialized"]
|
||||
[x] = 42; [10] = "meep"; ["not initialized"]
|
||||
m() { return 42; }
|
||||
|
||||
}
|
||||
@ -41,16 +41,6 @@ verifyProperty(C.prototype, "m", {
|
||||
writable: true,
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "a"), false);
|
||||
|
||||
verifyProperty(C, "a", {
|
||||
value: 39,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "b"), false);
|
||||
|
||||
|
@ -1,57 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-fields/static-computed-names.case
|
||||
// - src/class-fields/productions/cls-expr-new-no-sc-line-method.template
|
||||
/*---
|
||||
description: Static Computed property names (field definitions followed by a method in a new line without a semicolon)
|
||||
esid: prod-FieldDefinition
|
||||
features: [computed-property-names, class, class-fields-public]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
ClassElement:
|
||||
...
|
||||
FieldDefinition ;
|
||||
static FieldDefinition ;
|
||||
|
||||
FieldDefinition:
|
||||
ClassElementName Initializer_opt
|
||||
|
||||
ClassElementName:
|
||||
PropertyName
|
||||
|
||||
---*/
|
||||
|
||||
|
||||
var C = class {
|
||||
static ["a"] = 42; ["a"] = 39
|
||||
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);
|
||||
|
||||
verifyProperty(C, "a", {
|
||||
value: 42,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
verifyProperty(c, "a", {
|
||||
value: 39,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
@ -1,71 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-fields/static-computed-symbol-names.case
|
||||
// - src/class-fields/productions/cls-expr-new-no-sc-line-method.template
|
||||
/*---
|
||||
description: Static computed property symbol names (field definitions followed by a method in a new line without a semicolon)
|
||||
esid: prod-FieldDefinition
|
||||
features: [Symbol, computed-property-names, class, class-fields-public]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
ClassElement:
|
||||
...
|
||||
FieldDefinition ;
|
||||
|
||||
FieldDefinition:
|
||||
ClassElementName Initializer_opt
|
||||
|
||||
ClassElementName:
|
||||
PropertyName
|
||||
|
||||
---*/
|
||||
var x = Symbol();
|
||||
var y = Symbol();
|
||||
|
||||
|
||||
|
||||
var C = class {
|
||||
static [x]; static [y] = 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, x), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, x), false);
|
||||
|
||||
verifyProperty(C, x, {
|
||||
value: undefined,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, y), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, y), false);
|
||||
|
||||
verifyProperty(C, y, {
|
||||
value: 42,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "x"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "x"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "x"), false);
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "y"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "y"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "y"), false);
|
@ -1,74 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-fields/static-literal-names.case
|
||||
// - src/class-fields/productions/cls-expr-new-no-sc-line-method.template
|
||||
/*---
|
||||
description: Static literal property names (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
|
||||
|
||||
---*/
|
||||
const fn = function() {}
|
||||
|
||||
|
||||
|
||||
var C = class {
|
||||
static a; b = 42;
|
||||
static c = fn
|
||||
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
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "c"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "c"), false);
|
||||
|
||||
verifyProperty(C, "c", {
|
||||
value: fn,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
@ -1,67 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-fields/static-private-names.case
|
||||
// - src/class-fields/productions/cls-expr-new-no-sc-line-method.template
|
||||
/*---
|
||||
description: literal private names (field definitions followed by a method in a new line without a semicolon)
|
||||
esid: prod-FieldDefinition
|
||||
features: [class-fields-private, class, class-fields-public]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
ClassElement:
|
||||
...
|
||||
static FieldDefinition ;
|
||||
|
||||
FieldDefinition:
|
||||
ClassElementName Initializer_opt
|
||||
|
||||
ClassElementName:
|
||||
PrivateName
|
||||
|
||||
PrivateName:
|
||||
#IdentifierName
|
||||
|
||||
---*/
|
||||
|
||||
|
||||
var C = class {
|
||||
static #x; static #y
|
||||
m() { return 42; }
|
||||
static x() {
|
||||
this.#x = 42;
|
||||
return this.#x;
|
||||
}
|
||||
static y() {
|
||||
this.#y = 43;
|
||||
return this.#y;
|
||||
}
|
||||
}
|
||||
|
||||
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,
|
||||
});
|
||||
|
||||
// Test the private fields do not appear as properties before set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1");
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2");
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3");
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4");
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5");
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6");
|
||||
|
||||
// Test if private fields can be sucessfully accessed and set to value
|
||||
assert.sameValue(C.x(), 42, "test 7");
|
||||
assert.sameValue(C.y(), 43, "test 8");
|
||||
|
||||
// Test the private fields do not appear as properties before after set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9");
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10");
|
@ -24,7 +24,7 @@ var x = "b";
|
||||
|
||||
|
||||
var C = class {
|
||||
static ["a"] = 39; [x] = 42; [10] = "meep"; ["not initialized"];
|
||||
[x] = 42; [10] = "meep"; ["not initialized"];
|
||||
*m() { return 42; }
|
||||
|
||||
}
|
||||
@ -41,16 +41,6 @@ verifyProperty(C.prototype, "m", {
|
||||
writable: true,
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "a"), false);
|
||||
|
||||
verifyProperty(C, "a", {
|
||||
value: 39,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "b"), false);
|
||||
|
||||
|
@ -1,57 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-fields/static-computed-names.case
|
||||
// - src/class-fields/productions/cls-expr-new-sc-line-generator.template
|
||||
/*---
|
||||
description: Static Computed property names (field definitions followed by a method in a new line with a semicolon)
|
||||
esid: prod-FieldDefinition
|
||||
features: [computed-property-names, class, class-fields-public, generators]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
ClassElement:
|
||||
...
|
||||
FieldDefinition ;
|
||||
static FieldDefinition ;
|
||||
|
||||
FieldDefinition:
|
||||
ClassElementName Initializer_opt
|
||||
|
||||
ClassElementName:
|
||||
PropertyName
|
||||
|
||||
---*/
|
||||
|
||||
|
||||
var C = class {
|
||||
static ["a"] = 42; ["a"] = 39;
|
||||
*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);
|
||||
|
||||
verifyProperty(C, "a", {
|
||||
value: 42,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
verifyProperty(c, "a", {
|
||||
value: 39,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
@ -1,71 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-fields/static-computed-symbol-names.case
|
||||
// - src/class-fields/productions/cls-expr-new-sc-line-generator.template
|
||||
/*---
|
||||
description: Static computed property symbol names (field definitions followed by a method in a new line with a semicolon)
|
||||
esid: prod-FieldDefinition
|
||||
features: [Symbol, computed-property-names, class, class-fields-public, generators]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
ClassElement:
|
||||
...
|
||||
FieldDefinition ;
|
||||
|
||||
FieldDefinition:
|
||||
ClassElementName Initializer_opt
|
||||
|
||||
ClassElementName:
|
||||
PropertyName
|
||||
|
||||
---*/
|
||||
var x = Symbol();
|
||||
var y = Symbol();
|
||||
|
||||
|
||||
|
||||
var C = class {
|
||||
static [x]; static [y] = 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, x), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, x), false);
|
||||
|
||||
verifyProperty(C, x, {
|
||||
value: undefined,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, y), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, y), false);
|
||||
|
||||
verifyProperty(C, y, {
|
||||
value: 42,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "x"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "x"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "x"), false);
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "y"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "y"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "y"), false);
|
@ -1,74 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-fields/static-literal-names.case
|
||||
// - src/class-fields/productions/cls-expr-new-sc-line-generator.template
|
||||
/*---
|
||||
description: Static literal property names (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
|
||||
|
||||
---*/
|
||||
const fn = function() {}
|
||||
|
||||
|
||||
|
||||
var C = class {
|
||||
static a; b = 42;
|
||||
static c = fn;
|
||||
*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
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "c"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "c"), false);
|
||||
|
||||
verifyProperty(C, "c", {
|
||||
value: fn,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
@ -1,67 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-fields/static-private-names.case
|
||||
// - src/class-fields/productions/cls-expr-new-sc-line-generator.template
|
||||
/*---
|
||||
description: literal private names (field definitions followed by a method in a new line with a semicolon)
|
||||
esid: prod-FieldDefinition
|
||||
features: [class-fields-private, class, class-fields-public, generators]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
ClassElement:
|
||||
...
|
||||
static FieldDefinition ;
|
||||
|
||||
FieldDefinition:
|
||||
ClassElementName Initializer_opt
|
||||
|
||||
ClassElementName:
|
||||
PrivateName
|
||||
|
||||
PrivateName:
|
||||
#IdentifierName
|
||||
|
||||
---*/
|
||||
|
||||
|
||||
var C = class {
|
||||
static #x; static #y;
|
||||
*m() { return 42; }
|
||||
static x() {
|
||||
this.#x = 42;
|
||||
return this.#x;
|
||||
}
|
||||
static y() {
|
||||
this.#y = 43;
|
||||
return this.#y;
|
||||
}
|
||||
}
|
||||
|
||||
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,
|
||||
});
|
||||
|
||||
// Test the private fields do not appear as properties before set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1");
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2");
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3");
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4");
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5");
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6");
|
||||
|
||||
// Test if private fields can be sucessfully accessed and set to value
|
||||
assert.sameValue(C.x(), 42, "test 7");
|
||||
assert.sameValue(C.y(), 43, "test 8");
|
||||
|
||||
// Test the private fields do not appear as properties before after set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9");
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10");
|
@ -24,7 +24,7 @@ var x = "b";
|
||||
|
||||
|
||||
var C = class {
|
||||
static ["a"] = 39; [x] = 42; [10] = "meep"; ["not initialized"];
|
||||
[x] = 42; [10] = "meep"; ["not initialized"];
|
||||
m() { return 42; }
|
||||
|
||||
}
|
||||
@ -41,16 +41,6 @@ verifyProperty(C.prototype, "m", {
|
||||
writable: true,
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "a"), false);
|
||||
|
||||
verifyProperty(C, "a", {
|
||||
value: 39,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "b"), false);
|
||||
|
||||
|
@ -1,57 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-fields/static-computed-names.case
|
||||
// - src/class-fields/productions/cls-expr-new-sc-line-method.template
|
||||
/*---
|
||||
description: Static Computed property names (field definitions followed by a method in a new line with a semicolon)
|
||||
esid: prod-FieldDefinition
|
||||
features: [computed-property-names, class, class-fields-public]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
ClassElement:
|
||||
...
|
||||
FieldDefinition ;
|
||||
static FieldDefinition ;
|
||||
|
||||
FieldDefinition:
|
||||
ClassElementName Initializer_opt
|
||||
|
||||
ClassElementName:
|
||||
PropertyName
|
||||
|
||||
---*/
|
||||
|
||||
|
||||
var C = class {
|
||||
static ["a"] = 42; ["a"] = 39;
|
||||
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);
|
||||
|
||||
verifyProperty(C, "a", {
|
||||
value: 42,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
verifyProperty(c, "a", {
|
||||
value: 39,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
@ -1,71 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-fields/static-computed-symbol-names.case
|
||||
// - src/class-fields/productions/cls-expr-new-sc-line-method.template
|
||||
/*---
|
||||
description: Static computed property symbol names (field definitions followed by a method in a new line with a semicolon)
|
||||
esid: prod-FieldDefinition
|
||||
features: [Symbol, computed-property-names, class, class-fields-public]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
ClassElement:
|
||||
...
|
||||
FieldDefinition ;
|
||||
|
||||
FieldDefinition:
|
||||
ClassElementName Initializer_opt
|
||||
|
||||
ClassElementName:
|
||||
PropertyName
|
||||
|
||||
---*/
|
||||
var x = Symbol();
|
||||
var y = Symbol();
|
||||
|
||||
|
||||
|
||||
var C = class {
|
||||
static [x]; static [y] = 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, x), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, x), false);
|
||||
|
||||
verifyProperty(C, x, {
|
||||
value: undefined,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, y), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, y), false);
|
||||
|
||||
verifyProperty(C, y, {
|
||||
value: 42,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "x"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "x"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "x"), false);
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "y"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "y"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "y"), false);
|
@ -1,74 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-fields/static-literal-names.case
|
||||
// - src/class-fields/productions/cls-expr-new-sc-line-method.template
|
||||
/*---
|
||||
description: Static literal property names (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
|
||||
|
||||
---*/
|
||||
const fn = function() {}
|
||||
|
||||
|
||||
|
||||
var C = class {
|
||||
static a; b = 42;
|
||||
static c = fn;
|
||||
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
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "c"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "c"), false);
|
||||
|
||||
verifyProperty(C, "c", {
|
||||
value: fn,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
@ -1,67 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-fields/static-private-names.case
|
||||
// - src/class-fields/productions/cls-expr-new-sc-line-method.template
|
||||
/*---
|
||||
description: literal private names (field definitions followed by a method in a new line with a semicolon)
|
||||
esid: prod-FieldDefinition
|
||||
features: [class-fields-private, class, class-fields-public]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
ClassElement:
|
||||
...
|
||||
static FieldDefinition ;
|
||||
|
||||
FieldDefinition:
|
||||
ClassElementName Initializer_opt
|
||||
|
||||
ClassElementName:
|
||||
PrivateName
|
||||
|
||||
PrivateName:
|
||||
#IdentifierName
|
||||
|
||||
---*/
|
||||
|
||||
|
||||
var C = class {
|
||||
static #x; static #y;
|
||||
m() { return 42; }
|
||||
static x() {
|
||||
this.#x = 42;
|
||||
return this.#x;
|
||||
}
|
||||
static y() {
|
||||
this.#y = 43;
|
||||
return this.#y;
|
||||
}
|
||||
}
|
||||
|
||||
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,
|
||||
});
|
||||
|
||||
// Test the private fields do not appear as properties before set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1");
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2");
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3");
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4");
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5");
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6");
|
||||
|
||||
// Test if private fields can be sucessfully accessed and set to value
|
||||
assert.sameValue(C.x(), 42, "test 7");
|
||||
assert.sameValue(C.y(), 43, "test 8");
|
||||
|
||||
// Test the private fields do not appear as properties before after set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9");
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10");
|
@ -24,22 +24,12 @@ var x = "b";
|
||||
|
||||
|
||||
var C = class {
|
||||
static ["a"] = 39; [x] = 42; [10] = "meep"; ["not initialized"]
|
||||
[x] = 42; [10] = "meep"; ["not initialized"]
|
||||
|
||||
}
|
||||
|
||||
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: 39,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "b"), false);
|
||||
|
||||
|
@ -1,46 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-fields/static-computed-names.case
|
||||
// - src/class-fields/productions/cls-expr-regular-definitions.template
|
||||
/*---
|
||||
description: Static Computed property names (regular fields defintion)
|
||||
esid: prod-FieldDefinition
|
||||
features: [computed-property-names, class, class-fields-public]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
ClassElement:
|
||||
...
|
||||
FieldDefinition ;
|
||||
static FieldDefinition ;
|
||||
|
||||
FieldDefinition:
|
||||
ClassElementName Initializer_opt
|
||||
|
||||
ClassElementName:
|
||||
PropertyName
|
||||
|
||||
---*/
|
||||
|
||||
|
||||
var C = class {
|
||||
static ["a"] = 42; ["a"] = 39
|
||||
|
||||
}
|
||||
|
||||
var c = new C();
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false);
|
||||
|
||||
verifyProperty(C, "a", {
|
||||
value: 42,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
verifyProperty(c, "a", {
|
||||
value: 39,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
@ -1,60 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-fields/static-computed-symbol-names.case
|
||||
// - src/class-fields/productions/cls-expr-regular-definitions.template
|
||||
/*---
|
||||
description: Static computed property symbol names (regular fields defintion)
|
||||
esid: prod-FieldDefinition
|
||||
features: [Symbol, computed-property-names, class, class-fields-public]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
ClassElement:
|
||||
...
|
||||
FieldDefinition ;
|
||||
|
||||
FieldDefinition:
|
||||
ClassElementName Initializer_opt
|
||||
|
||||
ClassElementName:
|
||||
PropertyName
|
||||
|
||||
---*/
|
||||
var x = Symbol();
|
||||
var y = Symbol();
|
||||
|
||||
|
||||
|
||||
var C = class {
|
||||
static [x]; static [y] = 42
|
||||
|
||||
}
|
||||
|
||||
var c = new C();
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, x), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, x), false);
|
||||
|
||||
verifyProperty(C, x, {
|
||||
value: undefined,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, y), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, y), false);
|
||||
|
||||
verifyProperty(C, y, {
|
||||
value: 42,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "x"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "x"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "x"), false);
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "y"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "y"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "y"), false);
|
@ -1,63 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-fields/static-literal-names.case
|
||||
// - src/class-fields/productions/cls-expr-regular-definitions.template
|
||||
/*---
|
||||
description: Static literal property names (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
|
||||
|
||||
---*/
|
||||
const fn = function() {}
|
||||
|
||||
|
||||
|
||||
var C = class {
|
||||
static a; b = 42;
|
||||
static c = fn
|
||||
|
||||
}
|
||||
|
||||
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
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "c"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "c"), false);
|
||||
|
||||
verifyProperty(C, "c", {
|
||||
value: fn,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
@ -1,55 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-fields/static-private-names.case
|
||||
// - src/class-fields/productions/cls-expr-regular-definitions.template
|
||||
/*---
|
||||
description: literal private names (regular fields defintion)
|
||||
esid: prod-FieldDefinition
|
||||
features: [class-fields-private, class, class-fields-public]
|
||||
flags: [generated]
|
||||
info: |
|
||||
ClassElement:
|
||||
...
|
||||
static FieldDefinition ;
|
||||
|
||||
FieldDefinition:
|
||||
ClassElementName Initializer_opt
|
||||
|
||||
ClassElementName:
|
||||
PrivateName
|
||||
|
||||
PrivateName:
|
||||
#IdentifierName
|
||||
|
||||
---*/
|
||||
|
||||
|
||||
var C = class {
|
||||
static #x; static #y
|
||||
static x() {
|
||||
this.#x = 42;
|
||||
return this.#x;
|
||||
}
|
||||
static y() {
|
||||
this.#y = 43;
|
||||
return this.#y;
|
||||
}
|
||||
}
|
||||
|
||||
var c = new C();
|
||||
|
||||
// Test the private fields do not appear as properties before set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1");
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2");
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3");
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4");
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5");
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6");
|
||||
|
||||
// Test if private fields can be sucessfully accessed and set to value
|
||||
assert.sameValue(C.x(), 42, "test 7");
|
||||
assert.sameValue(C.y(), 43, "test 8");
|
||||
|
||||
// Test the private fields do not appear as properties before after set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9");
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10");
|
@ -24,7 +24,7 @@ var x = "b";
|
||||
|
||||
|
||||
var C = class {
|
||||
async *m() { return 42; } static ["a"] = 39; [x] = 42; [10] = "meep"; ["not initialized"];
|
||||
async *m() { return 42; } [x] = 42; [10] = "meep"; ["not initialized"];
|
||||
|
||||
}
|
||||
|
||||
@ -39,16 +39,6 @@ verifyProperty(C.prototype, "m", {
|
||||
writable: true,
|
||||
}, {restore: true});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "a"), false);
|
||||
|
||||
verifyProperty(C, "a", {
|
||||
value: 39,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "b"), false);
|
||||
|
||||
|
@ -1,60 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-fields/static-computed-names.case
|
||||
// - src/class-fields/productions/cls-expr-after-same-line-async-gen.template
|
||||
/*---
|
||||
description: Static Computed property names (field definitions after an async generator in the same line)
|
||||
esid: prod-FieldDefinition
|
||||
features: [computed-property-names, class, class-fields-public, async-iteration]
|
||||
flags: [generated, async]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
ClassElement:
|
||||
...
|
||||
FieldDefinition ;
|
||||
static FieldDefinition ;
|
||||
|
||||
FieldDefinition:
|
||||
ClassElementName Initializer_opt
|
||||
|
||||
ClassElementName:
|
||||
PropertyName
|
||||
|
||||
---*/
|
||||
|
||||
|
||||
var C = class {
|
||||
async *m() { return 42; } static ["a"] = 42; ["a"] = 39;
|
||||
|
||||
}
|
||||
|
||||
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});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false);
|
||||
|
||||
verifyProperty(C, "a", {
|
||||
value: 42,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
verifyProperty(c, "a", {
|
||||
value: 39,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
c.m().next().then(function(v) {
|
||||
assert.sameValue(v.value, 42);
|
||||
assert.sameValue(v.done, true);
|
||||
}, $DONE).then($DONE, $DONE);
|
@ -1,74 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-fields/static-computed-symbol-names.case
|
||||
// - src/class-fields/productions/cls-expr-after-same-line-async-gen.template
|
||||
/*---
|
||||
description: Static computed property symbol names (field definitions after an async generator in the same line)
|
||||
esid: prod-FieldDefinition
|
||||
features: [Symbol, computed-property-names, class, class-fields-public, async-iteration]
|
||||
flags: [generated, async]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
ClassElement:
|
||||
...
|
||||
FieldDefinition ;
|
||||
|
||||
FieldDefinition:
|
||||
ClassElementName Initializer_opt
|
||||
|
||||
ClassElementName:
|
||||
PropertyName
|
||||
|
||||
---*/
|
||||
var x = Symbol();
|
||||
var y = Symbol();
|
||||
|
||||
|
||||
|
||||
var C = class {
|
||||
async *m() { return 42; } static [x]; static [y] = 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});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, x), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, x), false);
|
||||
|
||||
verifyProperty(C, x, {
|
||||
value: undefined,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, y), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, y), false);
|
||||
|
||||
verifyProperty(C, y, {
|
||||
value: 42,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "x"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "x"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "x"), false);
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "y"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "y"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "y"), false);
|
||||
|
||||
c.m().next().then(function(v) {
|
||||
assert.sameValue(v.value, 42);
|
||||
assert.sameValue(v.done, true);
|
||||
}, $DONE).then($DONE, $DONE);
|
@ -1,77 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-fields/static-literal-names.case
|
||||
// - src/class-fields/productions/cls-expr-after-same-line-async-gen.template
|
||||
/*---
|
||||
description: Static literal property names (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
|
||||
|
||||
---*/
|
||||
const fn = function() {}
|
||||
|
||||
|
||||
|
||||
var C = class {
|
||||
async *m() { return 42; } static a; b = 42;
|
||||
static c = fn;
|
||||
|
||||
}
|
||||
|
||||
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});
|
||||
|
||||
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
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "c"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "c"), false);
|
||||
|
||||
verifyProperty(C, "c", {
|
||||
value: fn,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
|
||||
c.m().next().then(function(v) {
|
||||
assert.sameValue(v.value, 42);
|
||||
assert.sameValue(v.done, true);
|
||||
}, $DONE).then($DONE, $DONE);
|
@ -1,70 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-fields/static-private-names.case
|
||||
// - src/class-fields/productions/cls-expr-after-same-line-async-gen.template
|
||||
/*---
|
||||
description: literal private names (field definitions after an async generator in the same line)
|
||||
esid: prod-FieldDefinition
|
||||
features: [class-fields-private, class, class-fields-public, async-iteration]
|
||||
flags: [generated, async]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
ClassElement:
|
||||
...
|
||||
static FieldDefinition ;
|
||||
|
||||
FieldDefinition:
|
||||
ClassElementName Initializer_opt
|
||||
|
||||
ClassElementName:
|
||||
PrivateName
|
||||
|
||||
PrivateName:
|
||||
#IdentifierName
|
||||
|
||||
---*/
|
||||
|
||||
|
||||
var C = class {
|
||||
async *m() { return 42; } static #x; static #y;
|
||||
static x() {
|
||||
this.#x = 42;
|
||||
return this.#x;
|
||||
}
|
||||
static y() {
|
||||
this.#y = 43;
|
||||
return this.#y;
|
||||
}
|
||||
}
|
||||
|
||||
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});
|
||||
|
||||
// Test the private fields do not appear as properties before set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1");
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2");
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3");
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4");
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5");
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6");
|
||||
|
||||
// Test if private fields can be sucessfully accessed and set to value
|
||||
assert.sameValue(C.x(), 42, "test 7");
|
||||
assert.sameValue(C.y(), 43, "test 8");
|
||||
|
||||
// Test the private fields do not appear as properties before after set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9");
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10");
|
||||
|
||||
c.m().next().then(function(v) {
|
||||
assert.sameValue(v.value, 42);
|
||||
assert.sameValue(v.done, true);
|
||||
}, $DONE).then($DONE, $DONE);
|
@ -24,7 +24,7 @@ var x = "b";
|
||||
|
||||
|
||||
var C = class {
|
||||
async m() { return 42; } static ["a"] = 39; [x] = 42; [10] = "meep"; ["not initialized"];
|
||||
async m() { return 42; } [x] = 42; [10] = "meep"; ["not initialized"];
|
||||
|
||||
}
|
||||
|
||||
@ -39,16 +39,6 @@ verifyProperty(C.prototype, "m", {
|
||||
writable: true,
|
||||
}, {restore: true});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "a"), false);
|
||||
|
||||
verifyProperty(C, "a", {
|
||||
value: 39,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "b"), false);
|
||||
|
||||
|
@ -1,59 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-fields/static-computed-names.case
|
||||
// - src/class-fields/productions/cls-expr-after-same-line-async-method.template
|
||||
/*---
|
||||
description: Static Computed property names (field definitions after an async method in the same line)
|
||||
esid: prod-FieldDefinition
|
||||
features: [computed-property-names, class, class-fields-public, async-functions]
|
||||
flags: [generated, async]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
ClassElement:
|
||||
...
|
||||
FieldDefinition ;
|
||||
static FieldDefinition ;
|
||||
|
||||
FieldDefinition:
|
||||
ClassElementName Initializer_opt
|
||||
|
||||
ClassElementName:
|
||||
PropertyName
|
||||
|
||||
---*/
|
||||
|
||||
|
||||
var C = class {
|
||||
async m() { return 42; } static ["a"] = 42; ["a"] = 39;
|
||||
|
||||
}
|
||||
|
||||
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});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false);
|
||||
|
||||
verifyProperty(C, "a", {
|
||||
value: 42,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
verifyProperty(c, "a", {
|
||||
value: 39,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
c.m().then(function(v) {
|
||||
assert.sameValue(v, 42);
|
||||
}, $DONE).then($DONE, $DONE);
|
@ -1,73 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-fields/static-computed-symbol-names.case
|
||||
// - src/class-fields/productions/cls-expr-after-same-line-async-method.template
|
||||
/*---
|
||||
description: Static computed property symbol names (field definitions after an async method in the same line)
|
||||
esid: prod-FieldDefinition
|
||||
features: [Symbol, computed-property-names, class, class-fields-public, async-functions]
|
||||
flags: [generated, async]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
ClassElement:
|
||||
...
|
||||
FieldDefinition ;
|
||||
|
||||
FieldDefinition:
|
||||
ClassElementName Initializer_opt
|
||||
|
||||
ClassElementName:
|
||||
PropertyName
|
||||
|
||||
---*/
|
||||
var x = Symbol();
|
||||
var y = Symbol();
|
||||
|
||||
|
||||
|
||||
var C = class {
|
||||
async m() { return 42; } static [x]; static [y] = 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});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, x), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, x), false);
|
||||
|
||||
verifyProperty(C, x, {
|
||||
value: undefined,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, y), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, y), false);
|
||||
|
||||
verifyProperty(C, y, {
|
||||
value: 42,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "x"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "x"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "x"), false);
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "y"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "y"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "y"), false);
|
||||
|
||||
c.m().then(function(v) {
|
||||
assert.sameValue(v, 42);
|
||||
}, $DONE).then($DONE, $DONE);
|
@ -1,76 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-fields/static-literal-names.case
|
||||
// - src/class-fields/productions/cls-expr-after-same-line-async-method.template
|
||||
/*---
|
||||
description: Static literal property names (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
|
||||
|
||||
---*/
|
||||
const fn = function() {}
|
||||
|
||||
|
||||
|
||||
var C = class {
|
||||
async m() { return 42; } static a; b = 42;
|
||||
static c = fn;
|
||||
|
||||
}
|
||||
|
||||
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});
|
||||
|
||||
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
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "c"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "c"), false);
|
||||
|
||||
verifyProperty(C, "c", {
|
||||
value: fn,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
|
||||
c.m().then(function(v) {
|
||||
assert.sameValue(v, 42);
|
||||
}, $DONE).then($DONE, $DONE);
|
@ -1,69 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-fields/static-private-names.case
|
||||
// - src/class-fields/productions/cls-expr-after-same-line-async-method.template
|
||||
/*---
|
||||
description: literal private names (field definitions after an async method in the same line)
|
||||
esid: prod-FieldDefinition
|
||||
features: [class-fields-private, class, class-fields-public, async-functions]
|
||||
flags: [generated, async]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
ClassElement:
|
||||
...
|
||||
static FieldDefinition ;
|
||||
|
||||
FieldDefinition:
|
||||
ClassElementName Initializer_opt
|
||||
|
||||
ClassElementName:
|
||||
PrivateName
|
||||
|
||||
PrivateName:
|
||||
#IdentifierName
|
||||
|
||||
---*/
|
||||
|
||||
|
||||
var C = class {
|
||||
async m() { return 42; } static #x; static #y;
|
||||
static x() {
|
||||
this.#x = 42;
|
||||
return this.#x;
|
||||
}
|
||||
static y() {
|
||||
this.#y = 43;
|
||||
return this.#y;
|
||||
}
|
||||
}
|
||||
|
||||
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});
|
||||
|
||||
// Test the private fields do not appear as properties before set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1");
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2");
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3");
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4");
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5");
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6");
|
||||
|
||||
// Test if private fields can be sucessfully accessed and set to value
|
||||
assert.sameValue(C.x(), 42, "test 7");
|
||||
assert.sameValue(C.y(), 43, "test 8");
|
||||
|
||||
// Test the private fields do not appear as properties before after set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9");
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10");
|
||||
|
||||
c.m().then(function(v) {
|
||||
assert.sameValue(v, 42);
|
||||
}, $DONE).then($DONE, $DONE);
|
@ -24,7 +24,7 @@ var x = "b";
|
||||
|
||||
|
||||
var C = class {
|
||||
static ["a"] = 39; [x] = 42; [10] = "meep"; ["not initialized"]; *m() { return 42; }
|
||||
[x] = 42; [10] = "meep"; ["not initialized"]; *m() { return 42; }
|
||||
|
||||
}
|
||||
|
||||
@ -40,16 +40,6 @@ verifyProperty(C.prototype, "m", {
|
||||
writable: true,
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "a"), false);
|
||||
|
||||
verifyProperty(C, "a", {
|
||||
value: 39,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "b"), false);
|
||||
|
||||
|
@ -1,56 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-fields/static-computed-names.case
|
||||
// - src/class-fields/productions/cls-expr-same-line-generator.template
|
||||
/*---
|
||||
description: Static Computed property names (field definitions followed by a generator method in the same line)
|
||||
esid: prod-FieldDefinition
|
||||
features: [computed-property-names, class, class-fields-public, generators]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
ClassElement:
|
||||
...
|
||||
FieldDefinition ;
|
||||
static FieldDefinition ;
|
||||
|
||||
FieldDefinition:
|
||||
ClassElementName Initializer_opt
|
||||
|
||||
ClassElementName:
|
||||
PropertyName
|
||||
|
||||
---*/
|
||||
|
||||
|
||||
var C = class {
|
||||
static ["a"] = 42; ["a"] = 39; *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);
|
||||
|
||||
verifyProperty(C, "a", {
|
||||
value: 42,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
verifyProperty(c, "a", {
|
||||
value: 39,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
@ -1,70 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-fields/static-computed-symbol-names.case
|
||||
// - src/class-fields/productions/cls-expr-same-line-generator.template
|
||||
/*---
|
||||
description: Static computed property symbol names (field definitions followed by a generator method in the same line)
|
||||
esid: prod-FieldDefinition
|
||||
features: [Symbol, computed-property-names, class, class-fields-public, generators]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
ClassElement:
|
||||
...
|
||||
FieldDefinition ;
|
||||
|
||||
FieldDefinition:
|
||||
ClassElementName Initializer_opt
|
||||
|
||||
ClassElementName:
|
||||
PropertyName
|
||||
|
||||
---*/
|
||||
var x = Symbol();
|
||||
var y = Symbol();
|
||||
|
||||
|
||||
|
||||
var C = class {
|
||||
static [x]; static [y] = 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, x), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, x), false);
|
||||
|
||||
verifyProperty(C, x, {
|
||||
value: undefined,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, y), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, y), false);
|
||||
|
||||
verifyProperty(C, y, {
|
||||
value: 42,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "x"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "x"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "x"), false);
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "y"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "y"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "y"), false);
|
@ -1,73 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-fields/static-literal-names.case
|
||||
// - src/class-fields/productions/cls-expr-same-line-generator.template
|
||||
/*---
|
||||
description: Static literal property names (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
|
||||
|
||||
---*/
|
||||
const fn = function() {}
|
||||
|
||||
|
||||
|
||||
var C = class {
|
||||
static a; b = 42;
|
||||
static c = fn; *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
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "c"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "c"), false);
|
||||
|
||||
verifyProperty(C, "c", {
|
||||
value: fn,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
@ -1,66 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-fields/static-private-names.case
|
||||
// - src/class-fields/productions/cls-expr-same-line-generator.template
|
||||
/*---
|
||||
description: literal private names (field definitions followed by a generator method in the same line)
|
||||
esid: prod-FieldDefinition
|
||||
features: [class-fields-private, class, class-fields-public, generators]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
ClassElement:
|
||||
...
|
||||
static FieldDefinition ;
|
||||
|
||||
FieldDefinition:
|
||||
ClassElementName Initializer_opt
|
||||
|
||||
ClassElementName:
|
||||
PrivateName
|
||||
|
||||
PrivateName:
|
||||
#IdentifierName
|
||||
|
||||
---*/
|
||||
|
||||
|
||||
var C = class {
|
||||
static #x; static #y; *m() { return 42; }
|
||||
static x() {
|
||||
this.#x = 42;
|
||||
return this.#x;
|
||||
}
|
||||
static y() {
|
||||
this.#y = 43;
|
||||
return this.#y;
|
||||
}
|
||||
}
|
||||
|
||||
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,
|
||||
});
|
||||
|
||||
// Test the private fields do not appear as properties before set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1");
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2");
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3");
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4");
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5");
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6");
|
||||
|
||||
// Test if private fields can be sucessfully accessed and set to value
|
||||
assert.sameValue(C.x(), 42, "test 7");
|
||||
assert.sameValue(C.y(), 43, "test 8");
|
||||
|
||||
// Test the private fields do not appear as properties before after set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9");
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10");
|
@ -24,7 +24,7 @@ var x = "b";
|
||||
|
||||
|
||||
var C = class {
|
||||
static ["a"] = 39; [x] = 42; [10] = "meep"; ["not initialized"]; m() { return 42; }
|
||||
[x] = 42; [10] = "meep"; ["not initialized"]; m() { return 42; }
|
||||
|
||||
}
|
||||
|
||||
@ -40,16 +40,6 @@ verifyProperty(C.prototype, "m", {
|
||||
writable: true,
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "a"), false);
|
||||
|
||||
verifyProperty(C, "a", {
|
||||
value: 39,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "b"), false);
|
||||
|
||||
|
@ -1,56 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-fields/static-computed-names.case
|
||||
// - src/class-fields/productions/cls-expr-same-line-method.template
|
||||
/*---
|
||||
description: Static Computed property names (field definitions followed by a method in the same line)
|
||||
esid: prod-FieldDefinition
|
||||
features: [computed-property-names, class, class-fields-public]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
ClassElement:
|
||||
...
|
||||
FieldDefinition ;
|
||||
static FieldDefinition ;
|
||||
|
||||
FieldDefinition:
|
||||
ClassElementName Initializer_opt
|
||||
|
||||
ClassElementName:
|
||||
PropertyName
|
||||
|
||||
---*/
|
||||
|
||||
|
||||
var C = class {
|
||||
static ["a"] = 42; ["a"] = 39; 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);
|
||||
|
||||
verifyProperty(C, "a", {
|
||||
value: 42,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
verifyProperty(c, "a", {
|
||||
value: 39,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
@ -1,70 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-fields/static-computed-symbol-names.case
|
||||
// - src/class-fields/productions/cls-expr-same-line-method.template
|
||||
/*---
|
||||
description: Static computed property symbol names (field definitions followed by a method in the same line)
|
||||
esid: prod-FieldDefinition
|
||||
features: [Symbol, computed-property-names, class, class-fields-public]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
ClassElement:
|
||||
...
|
||||
FieldDefinition ;
|
||||
|
||||
FieldDefinition:
|
||||
ClassElementName Initializer_opt
|
||||
|
||||
ClassElementName:
|
||||
PropertyName
|
||||
|
||||
---*/
|
||||
var x = Symbol();
|
||||
var y = Symbol();
|
||||
|
||||
|
||||
|
||||
var C = class {
|
||||
static [x]; static [y] = 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, x), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, x), false);
|
||||
|
||||
verifyProperty(C, x, {
|
||||
value: undefined,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, y), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, y), false);
|
||||
|
||||
verifyProperty(C, y, {
|
||||
value: 42,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "x"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "x"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "x"), false);
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "y"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "y"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "y"), false);
|
@ -1,73 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-fields/static-literal-names.case
|
||||
// - src/class-fields/productions/cls-expr-same-line-method.template
|
||||
/*---
|
||||
description: Static literal property names (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
|
||||
|
||||
---*/
|
||||
const fn = function() {}
|
||||
|
||||
|
||||
|
||||
var C = class {
|
||||
static a; b = 42;
|
||||
static c = fn; 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
|
||||
});
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "c"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "c"), false);
|
||||
|
||||
verifyProperty(C, "c", {
|
||||
value: fn,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
@ -1,66 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-fields/static-private-names.case
|
||||
// - src/class-fields/productions/cls-expr-same-line-method.template
|
||||
/*---
|
||||
description: literal private names (field definitions followed by a method in the same line)
|
||||
esid: prod-FieldDefinition
|
||||
features: [class-fields-private, class, class-fields-public]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
ClassElement:
|
||||
...
|
||||
static FieldDefinition ;
|
||||
|
||||
FieldDefinition:
|
||||
ClassElementName Initializer_opt
|
||||
|
||||
ClassElementName:
|
||||
PrivateName
|
||||
|
||||
PrivateName:
|
||||
#IdentifierName
|
||||
|
||||
---*/
|
||||
|
||||
|
||||
var C = class {
|
||||
static #x; static #y; m() { return 42; }
|
||||
static x() {
|
||||
this.#x = 42;
|
||||
return this.#x;
|
||||
}
|
||||
static y() {
|
||||
this.#y = 43;
|
||||
return this.#y;
|
||||
}
|
||||
}
|
||||
|
||||
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,
|
||||
});
|
||||
|
||||
// Test the private fields do not appear as properties before set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1");
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2");
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3");
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4");
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5");
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6");
|
||||
|
||||
// Test if private fields can be sucessfully accessed and set to value
|
||||
assert.sameValue(C.x(), 42, "test 7");
|
||||
assert.sameValue(C.y(), 43, "test 8");
|
||||
|
||||
// Test the private fields do not appear as properties before after set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9");
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10");
|
@ -1,35 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-fields/init-err-contains-arguments.case
|
||||
// - src/class-fields/initializer-error/cls-expr-fields-static-comp-name.template
|
||||
/*---
|
||||
description: Syntax error if `arguments` used in class field (static computed ClassElementName)
|
||||
esid: sec-class-definitions-static-semantics-early-errors
|
||||
features: [class, class-fields-public]
|
||||
flags: [generated]
|
||||
negative:
|
||||
phase: early
|
||||
type: SyntaxError
|
||||
info: |
|
||||
Static Semantics: Early Errors
|
||||
|
||||
FieldDefinition:
|
||||
PropertyNameInitializeropt
|
||||
|
||||
- It is a Syntax Error if ContainsArguments of Initializer is true.
|
||||
|
||||
Static Semantics: ContainsArguments
|
||||
IdentifierReference : Identifier
|
||||
|
||||
1. If the StringValue of Identifier is "arguments", return true.
|
||||
...
|
||||
For all other grammatical productions, recurse on all nonterminals. If any piece returns true, then return true. Otherwise return false.
|
||||
|
||||
---*/
|
||||
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
var x = "string";
|
||||
var C = class {
|
||||
static [x] = arguments;
|
||||
}
|
@ -1,28 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-fields/init-err-contains-super.case
|
||||
// - src/class-fields/initializer-error/cls-expr-fields-static-comp-name.template
|
||||
/*---
|
||||
description: Syntax error if `super()` used in class field (static computed ClassElementName)
|
||||
esid: sec-class-definitions-static-semantics-early-errors
|
||||
features: [class, class-fields-public]
|
||||
flags: [generated]
|
||||
negative:
|
||||
phase: early
|
||||
type: SyntaxError
|
||||
info: |
|
||||
Static Semantics: Early Errors
|
||||
|
||||
FieldDefinition:
|
||||
PropertyNameInitializeropt
|
||||
|
||||
- It is a Syntax Error if Initializer is present and Initializer Contains SuperCall is true.
|
||||
|
||||
---*/
|
||||
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
var x = "string";
|
||||
var C = class {
|
||||
static [x] = super();
|
||||
}
|
@ -1,105 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-fields/static-computed-name-toprimitive-symbol.case
|
||||
// - src/class-fields/default/cls-expr.template
|
||||
/*---
|
||||
description: ToPrimitive evaluation in the ComputedPropertyName (field definitions in a class expression)
|
||||
esid: prod-FieldDefinition
|
||||
features: [computed-property-names, Symbol.toPrimitive, Symbol, class, class-fields-public]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
Runtime Semantics: ClassDefinitionEvaluation
|
||||
|
||||
...
|
||||
27. For each ClassElement e in order from elements
|
||||
a. If IsStatic of me is false, then
|
||||
i. Let fields be the result of performing ClassElementEvaluation for e with arguments proto and false.
|
||||
b. Else,
|
||||
i. Let fields be the result of performing ClassElementEvaluation for e with arguments F and false.
|
||||
c. If fields is an abrupt completion, then
|
||||
i. Set the running execution context's LexicalEnvironment to lex.
|
||||
ii. Set the running execution context's PrivateNameEnvironment to outerPrivateEnvironment.
|
||||
iii. Return Completion(status).
|
||||
...
|
||||
|
||||
Runtime Semantics: ClassElementEvaluation
|
||||
|
||||
ClassElement: static FieldDefinition;
|
||||
Return ClassFieldDefinitionEvaluation of FieldDefinition with parameter true and object.
|
||||
|
||||
ClassElement: FieldDefinition;
|
||||
Return ClassFieldDefinitionEvaluation of FieldDefinition with parameter false and object.
|
||||
|
||||
Runtime Semantics: ClassFieldDefinitionEvaluation
|
||||
With parameters isStatic and homeObject.
|
||||
|
||||
1. Let fieldName be the result of evaluating ClassElementName.
|
||||
2. ReturnIfAbrupt(fieldName).
|
||||
...
|
||||
|
||||
Runtime Semantics: Evaluation
|
||||
ComputedPropertyName: [ AssignmentExpression ]
|
||||
|
||||
1. Let exprValue be the result of evaluating AssignmentExpression.
|
||||
2. Let propName be ? GetValue(exprValue).
|
||||
3. Return ? ToPropertyKey(propName).
|
||||
|
||||
---*/
|
||||
var s1 = Symbol();
|
||||
var s2 = Symbol();
|
||||
var s3 = Symbol();
|
||||
var err = function() { throw new Test262Error(); };
|
||||
var obj1 = {
|
||||
[Symbol.toPrimitive]: function() { return s1; },
|
||||
toString: err,
|
||||
valueOf: err
|
||||
};
|
||||
|
||||
var obj2 = {
|
||||
toString: function() { return s2; },
|
||||
valueOf: err
|
||||
};
|
||||
|
||||
var obj3 = {
|
||||
toString: undefined,
|
||||
valueOf: function() { return s3; }
|
||||
};
|
||||
|
||||
|
||||
|
||||
var C = class {
|
||||
static [obj1] = 42;
|
||||
static [obj2] = 43;
|
||||
static [obj3] = 44;
|
||||
}
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, s1), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, s2), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, s3), false);
|
||||
|
||||
verifyProperty(C, s1, {
|
||||
value: 42,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
verifyProperty(C, s2, {
|
||||
value: 43,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
verifyProperty(C, s3, {
|
||||
value: 44,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
var c = new C();
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, s1), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, s2), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, s3), false);
|
@ -1,102 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-fields/static-computed-name-toprimitive.case
|
||||
// - src/class-fields/default/cls-expr.template
|
||||
/*---
|
||||
description: ToPrimitive evaluation in the ComputedPropertyName (field definitions in a class expression)
|
||||
esid: prod-FieldDefinition
|
||||
features: [computed-property-names, Symbol.toPrimitive, class, class-fields-public]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
Runtime Semantics: ClassDefinitionEvaluation
|
||||
|
||||
...
|
||||
27. For each ClassElement e in order from elements
|
||||
a. If IsStatic of me is false, then
|
||||
i. Let fields be the result of performing ClassElementEvaluation for e with arguments proto and false.
|
||||
b. Else,
|
||||
i. Let fields be the result of performing ClassElementEvaluation for e with arguments F and false.
|
||||
c. If fields is an abrupt completion, then
|
||||
i. Set the running execution context's LexicalEnvironment to lex.
|
||||
ii. Set the running execution context's PrivateNameEnvironment to outerPrivateEnvironment.
|
||||
iii. Return Completion(status).
|
||||
...
|
||||
|
||||
Runtime Semantics: ClassElementEvaluation
|
||||
|
||||
ClassElement: static FieldDefinition;
|
||||
Return ClassFieldDefinitionEvaluation of FieldDefinition with parameter true and object.
|
||||
|
||||
ClassElement: FieldDefinition;
|
||||
Return ClassFieldDefinitionEvaluation of FieldDefinition with parameter false and object.
|
||||
|
||||
Runtime Semantics: ClassFieldDefinitionEvaluation
|
||||
With parameters isStatic and homeObject.
|
||||
|
||||
1. Let fieldName be the result of evaluating ClassElementName.
|
||||
2. ReturnIfAbrupt(fieldName).
|
||||
...
|
||||
|
||||
Runtime Semantics: Evaluation
|
||||
ComputedPropertyName: [ AssignmentExpression ]
|
||||
|
||||
1. Let exprValue be the result of evaluating AssignmentExpression.
|
||||
2. Let propName be ? GetValue(exprValue).
|
||||
3. Return ? ToPropertyKey(propName).
|
||||
|
||||
---*/
|
||||
var err = function() { throw new Test262Error(); };
|
||||
var obj1 = {
|
||||
[Symbol.toPrimitive]: function() { return "d"; },
|
||||
toString: err,
|
||||
valueOf: err
|
||||
};
|
||||
|
||||
var obj2 = {
|
||||
toString: function() { return "e"; },
|
||||
valueOf: err
|
||||
};
|
||||
|
||||
var obj3 = {
|
||||
toString: undefined,
|
||||
valueOf: function() { return "f"; }
|
||||
};
|
||||
|
||||
|
||||
|
||||
var C = class {
|
||||
static [obj1] = 42;
|
||||
static [obj2] = 43;
|
||||
static [obj3] = 44;
|
||||
}
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "d"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "e"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "f"), false);
|
||||
|
||||
verifyProperty(C, "d", {
|
||||
value: 42,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
verifyProperty(C, "e", {
|
||||
value: 43,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
verifyProperty(C, "f", {
|
||||
value: 44,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
var c = new C();
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "d"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "e"), false);
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "f"), false);
|
@ -1,34 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-fields/init-err-contains-arguments.case
|
||||
// - src/class-fields/initializer-error/cls-expr-fields-static-literal-name.template
|
||||
/*---
|
||||
description: Syntax error if `arguments` used in class field (static literal ClassElementName)
|
||||
esid: sec-class-definitions-static-semantics-early-errors
|
||||
features: [class, class-fields-public]
|
||||
flags: [generated]
|
||||
negative:
|
||||
phase: early
|
||||
type: SyntaxError
|
||||
info: |
|
||||
Static Semantics: Early Errors
|
||||
|
||||
FieldDefinition:
|
||||
PropertyNameInitializeropt
|
||||
|
||||
- It is a Syntax Error if ContainsArguments of Initializer is true.
|
||||
|
||||
Static Semantics: ContainsArguments
|
||||
IdentifierReference : Identifier
|
||||
|
||||
1. If the StringValue of Identifier is "arguments", return true.
|
||||
...
|
||||
For all other grammatical productions, recurse on all nonterminals. If any piece returns true, then return true. Otherwise return false.
|
||||
|
||||
---*/
|
||||
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
var C = class {
|
||||
static x = arguments;
|
||||
}
|
@ -1,27 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-fields/init-err-contains-super.case
|
||||
// - src/class-fields/initializer-error/cls-expr-fields-static-literal-name.template
|
||||
/*---
|
||||
description: Syntax error if `super()` used in class field (static literal ClassElementName)
|
||||
esid: sec-class-definitions-static-semantics-early-errors
|
||||
features: [class, class-fields-public]
|
||||
flags: [generated]
|
||||
negative:
|
||||
phase: early
|
||||
type: SyntaxError
|
||||
info: |
|
||||
Static Semantics: Early Errors
|
||||
|
||||
FieldDefinition:
|
||||
PropertyNameInitializeropt
|
||||
|
||||
- It is a Syntax Error if Initializer is present and Initializer Contains SuperCall is true.
|
||||
|
||||
---*/
|
||||
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
var C = class {
|
||||
static x = super();
|
||||
}
|
@ -1,34 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-fields/init-err-contains-arguments.case
|
||||
// - src/class-fields/initializer-error/cls-expr-fields-static-private-name.template
|
||||
/*---
|
||||
description: Syntax error if `arguments` used in class field (static PrivateName)
|
||||
esid: sec-class-definitions-static-semantics-early-errors
|
||||
features: [class, class-fields-public, class-fields-private]
|
||||
flags: [generated]
|
||||
negative:
|
||||
phase: early
|
||||
type: SyntaxError
|
||||
info: |
|
||||
Static Semantics: Early Errors
|
||||
|
||||
FieldDefinition:
|
||||
PropertyNameInitializeropt
|
||||
|
||||
- It is a Syntax Error if ContainsArguments of Initializer is true.
|
||||
|
||||
Static Semantics: ContainsArguments
|
||||
IdentifierReference : Identifier
|
||||
|
||||
1. If the StringValue of Identifier is "arguments", return true.
|
||||
...
|
||||
For all other grammatical productions, recurse on all nonterminals. If any piece returns true, then return true. Otherwise return false.
|
||||
|
||||
---*/
|
||||
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
var C = class {
|
||||
static #x = arguments;
|
||||
}
|
@ -1,27 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-fields/init-err-contains-super.case
|
||||
// - src/class-fields/initializer-error/cls-expr-fields-static-private-name.template
|
||||
/*---
|
||||
description: Syntax error if `super()` used in class field (static PrivateName)
|
||||
esid: sec-class-definitions-static-semantics-early-errors
|
||||
features: [class, class-fields-public, class-fields-private]
|
||||
flags: [generated]
|
||||
negative:
|
||||
phase: early
|
||||
type: SyntaxError
|
||||
info: |
|
||||
Static Semantics: Early Errors
|
||||
|
||||
FieldDefinition:
|
||||
PropertyNameInitializeropt
|
||||
|
||||
- It is a Syntax Error if Initializer is present and Initializer Contains SuperCall is true.
|
||||
|
||||
---*/
|
||||
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
var C = class {
|
||||
static #x = super();
|
||||
}
|
@ -1,50 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-fields/static-redeclaration-symbol.case
|
||||
// - src/class-fields/default/cls-expr.template
|
||||
/*---
|
||||
description: Redeclaration of public static fields with the same name (field definitions in a class expression)
|
||||
esid: prod-FieldDefinition
|
||||
features: [class, class-fields-public]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js, compareArray.js]
|
||||
info: |
|
||||
2.13.2 Runtime Semantics: ClassDefinitionEvaluation
|
||||
|
||||
...
|
||||
30. Set the value of F's [[Fields]] internal slot to fieldRecords.
|
||||
...
|
||||
33. Let result be InitializeStaticFields(F).
|
||||
|
||||
InitializeStaticFields(F)
|
||||
|
||||
3. Let fieldRecords be the value of F's [[Fields]] internal slot.
|
||||
4. For each item fieldRecord in order from fieldRecords,
|
||||
a. If fieldRecord.[[static]] is true, then
|
||||
i. Perform ? DefineField(F, fieldRecord).
|
||||
|
||||
---*/
|
||||
var x = [];
|
||||
var y = Symbol();
|
||||
|
||||
|
||||
var C = class {
|
||||
static [y] = (x.push("a"), "old_value");
|
||||
static [y] = (x.push("b"), "same_value");
|
||||
static [y] = (x.push("c"), "same_value");
|
||||
}
|
||||
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, y), false);
|
||||
|
||||
verifyProperty(C, y, {
|
||||
value: "same_value",
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
assert(compareArray(x, ["a", "b", "c"]));
|
||||
|
||||
var c = new C();
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, y), false);
|
||||
|
||||
assert(compareArray(x, ["a", "b", "c"]), "static fields are not redefined on class instatiation");
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user