summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/language/statements/class/elements/field-definition-accessor-no-line-terminator.js
blob: bea195d730d03662946a163d3b9a62b0f975282e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// |reftest| skip -- decorators is not supported
// This file was procedurally generated from the following sources:
// - src/class-elements/field-definition-accessor-no-line-terminator.case
// - src/class-elements/default/cls-decl.template
/*---
description: Valid accessor FieldDefinition, ClassElementName, PropertyName Syntax (field definitions in a class declaration)
esid: prod-FieldDefinition
features: [decorators, class]
flags: [generated]
info: |
    FieldDefinition[Yield, Await] :
      accessor [no LineTerminator here] ClassElementName[?Yield, ?Await] Initializer[+In, ?Yield, ?Await]opt

---*/


class C {
  accessor
  $;
  static accessor
  $;

}

let c = new C();

assert(
  !Object.prototype.hasOwnProperty.call(C.prototype, 'accessor'),
  "accessor doesn't appear as an own property on C prototype"
);
assert(
  !Object.prototype.hasOwnProperty.call(C.prototype, '$'),
  "$ doesn't appear as an own property on C prototype"
);
assert(
  Object.prototype.hasOwnProperty.call(C, 'accessor'),
  "C constructor has an own property accessor"
);
assert(
  !Object.prototype.hasOwnProperty.call(C, '$'),
  "$ doesn't appear as an own property on C constructor"
);
assert(
  Object.prototype.hasOwnProperty.call(c, 'accessor'),
  "C instance has an own property accessor"
);
assert(
  Object.prototype.hasOwnProperty.call(c, '$'),
  "C instance has an own property $"
);

reportCompare(0, 0);