| 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-after-same-line-static-async-method.template |
| 4 |
/*--- |
| 5 |
description: String literal names (field definitions after a static async method in the same line) |
| 6 |
esid: prod-FieldDefinition |
| 7 |
features: [class, class-fields-public, async-functions] |
| 8 |
flags: [generated, async] |
| 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 |
static async m() { return 42; } 'a'; "b"; 'c' = 39; |
| 26 |
"d" = 42; |
| 27 |
|
| 28 |
} |
| 29 |
|
| 30 |
var c = new C(); |
| 31 |
|
| 32 |
assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); |
| 33 |
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); |
| 34 |
|
| 35 |
verifyProperty(C, "m", { |
| 36 |
enumerable: false, |
| 37 |
configurable: true, |
| 38 |
writable: true, |
| 39 |
}, {restore: true}); |
| 40 |
|
| 41 |
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); |
| 42 |
assert.sameValue(Object.hasOwnProperty.call(C, "a"), false); |
| 43 |
|
| 44 |
verifyProperty(c, "a", { |
| 45 |
value: undefined, |
| 46 |
enumerable: true, |
| 47 |
writable: true, |
| 48 |
configurable: true |
| 49 |
}); |
| 50 |
|
| 51 |
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); |
| 52 |
assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); |
| 53 |
|
| 54 |
verifyProperty(c, "b", { |
| 55 |
value: undefined, |
| 56 |
enumerable: true, |
| 57 |
writable: true, |
| 58 |
configurable: true |
| 59 |
}); |
| 60 |
|
| 61 |
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "c"), false); |
| 62 |
assert.sameValue(Object.hasOwnProperty.call(C, "c"), false); |
| 63 |
|
| 64 |
verifyProperty(c, "c", { |
| 65 |
value: 39, |
| 66 |
enumerable: true, |
| 67 |
writable: true, |
| 68 |
configurable: true |
| 69 |
}); |
| 70 |
|
| 71 |
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "d"), false); |
| 72 |
assert.sameValue(Object.hasOwnProperty.call(C, "d"), false); |
| 73 |
|
| 74 |
verifyProperty(c, "d", { |
| 75 |
value: 42, |
| 76 |
enumerable: true, |
| 77 |
writable: true, |
| 78 |
configurable: true |
| 79 |
}); |
| 80 |
|
| 81 |
C.m().then(function(v) { |
| 82 |
assert.sameValue(v, 42); |
| 83 |
}, $DONE).then($DONE, $DONE); |