Debian Codegraph @

js/src/tests/test262/language/statements/class/elements/after-same-line-static-method-literal-names-asi.js

raw
1 // This file was procedurally generated from the following sources:
2 // - src/class-elements/literal-names-asi.case
3 // - src/class-elements/productions/cls-decl-after-same-line-static-method.template
4 /*---
5 description: Literal property names with ASI (field definitions after a static method in the same line)
6 esid: prod-FieldDefinition
7 features: [class-fields-public, class]
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 class C {
25 static m() { return 42; } a
26 b = 42;;
27
28 }
29
30 var c = new C();
31
32 assert.sameValue(C.m(), 42);
33 assert(
34 !Object.prototype.hasOwnProperty.call(c, "m"),
35 "m doesn't appear as an own property on the C instance"
36 );
37 assert(
38 !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
39 "m doesn't appear as an own property on the C prototype"
40 );
41
42 verifyProperty(C, "m", {
43 enumerable: false,
44 configurable: true,
45 writable: true,
46 });
47
48 assert(
49 !Object.prototype.hasOwnProperty.call(C.prototype, "a"),
50 "a doesn't appear as an own property on C prototype"
51 );
52 assert(
53 !Object.prototype.hasOwnProperty.call(C, "a"),
54 "a doesn't appear as an own property on C constructor"
55 );
56
57 verifyProperty(c, "a", {
58 value: undefined,
59 enumerable: true,
60 writable: true,
61 configurable: true
62 });
63
64 assert(
65 !Object.prototype.hasOwnProperty.call(C.prototype, "b"),
66 "b doesn't appear as an own property on C prototype"
67 );
68 assert(
69 !Object.prototype.hasOwnProperty.call(C, "b"),
70 "b doesn't appear as an own property on C constructor"
71 );
72
73 verifyProperty(c, "b", {
74 value: 42,
75 enumerable: true,
76 writable: true,
77 configurable: true
78 });
79
80 reportCompare(0, 0);