summaryrefslogtreecommitdiff
path: root/src/class-fields/propname-error/cls-decl-computed-name.template
blob: 72e252f80884f7457cbe5e53d78fbc053b021f8d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// Copyright (C) 2017 Valerie Young. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/*---
esid: sec-class-definitions-static-semantics-early-errors
path: language/statements/class/fields-computed-name-
name: computed
info: |
  Static Semantics: PropName
  ...
  ComputedPropertyName : [ AssignmentExpression ]
    Return empty.
---*/

var x = "/*{ propname }*/";
class C {
  /*{ static }*/ [x];
}

var c = new C();

assert.sameValue(c.hasOwnProperty("/*{ propname }*/"), true);