test262/test/language/expressions/class/fields-multiple-stacked-def...

95 lines
2.1 KiB
JavaScript
Raw Normal View History

2017-08-21 22:59:36 +02:00
// This file was procedurally generated from the following sources:
// - src/class-fields/string-literal-names.case
2017-11-13 23:32:32 +01:00
// - src/class-fields/productions/cls-expr-multiple-stacked-definitions.template
2017-08-21 22:59:36 +02:00
/*---
description: String literal names (multiple stacked fields definitions through ASI)
2017-10-17 23:47:52 +02:00
esid: prod-FieldDefinition
2017-08-21 22:59:36 +02:00
features: [class-fields]
flags: [generated]
includes: [propertyHelper.js]
info: |
ClassElement:
...
FieldDefinition ;
FieldDefinition:
ClassElementName Initializer_opt
ClassElementName:
PropertyName
---*/
var C = class {
'a'; "b"; 'c' = 39;
"d" = 42
foo = "foobar"
bar = "barbaz";
2017-10-30 05:39:14 +01:00
2017-08-21 22:59:36 +02:00
}
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",
2017-09-01 23:45:01 +02:00
enumerable: true,
2017-08-21 22:59:36 +02:00
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",
2017-09-01 23:45:01 +02:00
enumerable: true,
2017-08-21 22:59:36 +02:00
configurable: true,
writable: true,
});
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false);
assert.sameValue(Object.hasOwnProperty.call(C, "a"), false);
verifyProperty(c, "a", {
2017-09-01 23:45:01 +02:00
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: undefined,
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: 39,
enumerable: true,
writable: true,
configurable: true
});
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "d"), false);
assert.sameValue(Object.hasOwnProperty.call(C, "d"), false);
verifyProperty(c, "d", {
2017-08-21 22:59:36 +02:00
value: 42,
enumerable: true,
writable: true,
configurable: true
});