summaryrefslogtreecommitdiff
path: root/src/class-fields/static-computed-names.case
blob: 25905f004a19a642deb90899dab7539c410713bf (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
// Copyright (C) 2017 the V8 project authors, 2017 Igalia S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/*---
esid: prod-FieldDefinition
desc: Static Computed property names
info: |
  ClassElement:
    ...
    FieldDefinition ;
    static FieldDefinition ;

  FieldDefinition:
    ClassElementName Initializer_opt

  ClassElementName:
    PropertyName
template: default
includes: [propertyHelper.js]
features: [computed-property-names]
---*/

//- fields
static ["a"] = 42; ["a"] = 39
//- assertions
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false);

verifyProperty(C, "a", {
  value: 42,
  enumerable: true,
  writable: true,
  configurable: true
});

verifyProperty(c, "a", {
  value: 39,
  enumerable: true,
  writable: true,
  configurable: true
});