| 1 |
// This file was procedurally generated from the following sources: |
| 2 |
// - src/class-fields/string-literal-names.case |
| 3 |
// - src/class-fields/productions/cls-expr-regular-definitions.template |
| 4 |
/*--- |
| 5 |
description: String literal names (regular fields defintion) |
| 6 |
esid: prod-FieldDefinition |
| 7 |
features: [class, class-fields-public] |
| 8 |
flags: [generated] |
| 9 |
includes: [propertyHelper.js] |
| 10 |
info: | |
| 11 |
ClassElement: |
| 12 |
... |
| 13 |
FieldDefinition ; |
| 14 |
|
| 15 |
FieldDefinition: |
| 16 |
ClassElementName Initializer_opt |
| 17 |
|
| 18 |
ClassElementName: |
| 19 |
PropertyName |
| 20 |
|
| 21 |
---*/ |
| 22 |
|
| 23 |
|
| 24 |
var C = class { |
| 25 |
'a'; "b"; 'c' = 39; |
| 26 |
"d" = 42 |
| 27 |
|
| 28 |
} |
| 29 |
|
| 30 |
var c = new C(); |
| 31 |
|
| 32 |
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); |
| 33 |
assert.sameValue(Object.hasOwnProperty.call(C, "a"), false); |
| 34 |
|
| 35 |
verifyProperty(c, "a", { |
| 36 |
value: undefined, |
| 37 |
enumerable: true, |
| 38 |
writable: true, |
| 39 |
configurable: true |
| 40 |
}); |
| 41 |
|
| 42 |
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); |
| 43 |
assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); |
| 44 |
|
| 45 |
verifyProperty(c, "b", { |
| 46 |
value: undefined, |
| 47 |
enumerable: true, |
| 48 |
writable: true, |
| 49 |
configurable: true |
| 50 |
}); |
| 51 |
|
| 52 |
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "c"), false); |
| 53 |
assert.sameValue(Object.hasOwnProperty.call(C, "c"), false); |
| 54 |
|
| 55 |
verifyProperty(c, "c", { |
| 56 |
value: 39, |
| 57 |
enumerable: true, |
| 58 |
writable: true, |
| 59 |
configurable: true |
| 60 |
}); |
| 61 |
|
| 62 |
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "d"), false); |
| 63 |
assert.sameValue(Object.hasOwnProperty.call(C, "d"), false); |
| 64 |
|
| 65 |
verifyProperty(c, "d", { |
| 66 |
value: 42, |
| 67 |
enumerable: true, |
| 68 |
writable: true, |
| 69 |
configurable: true |
| 70 |
}); |