Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/language/expressions/class/fields-after-same-line-method-string-literal-names.js

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