summaryrefslogtreecommitdiff
path: root/src/class-fields/static-computed-names.case
diff options
context:
space:
mode:
Diffstat (limited to 'src/class-fields/static-computed-names.case')
-rw-r--r--src/class-fields/static-computed-names.case40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/class-fields/static-computed-names.case b/src/class-fields/static-computed-names.case
new file mode 100644
index 000000000..25905f004
--- /dev/null
+++ b/src/class-fields/static-computed-names.case
@@ -0,0 +1,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
+});