Debian Codegraph @

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