summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/language/computed-property-names/class/method/generator.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/tests/test262/language/computed-property-names/class/method/generator.js')
-rw-r--r--js/src/tests/test262/language/computed-property-names/class/method/generator.js25
1 files changed, 25 insertions, 0 deletions
diff --git a/js/src/tests/test262/language/computed-property-names/class/method/generator.js b/js/src/tests/test262/language/computed-property-names/class/method/generator.js
new file mode 100644
index 0000000000..cfd471bc8c
--- /dev/null
+++ b/js/src/tests/test262/language/computed-property-names/class/method/generator.js
@@ -0,0 +1,25 @@
+// Copyright (C) 2014 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+es6id: 12.2.5
+description: >
+ computed property names can be used as the name of a generator method in a class
+includes: [compareArray.js]
+---*/
+class C {
+ *['a']() {
+ yield 1;
+ yield 2;
+ }
+}
+assert.sameValue(
+ Object.keys(C.prototype).length,
+ 0,
+ "The value of `Object.keys(C.prototype).length` is `0`"
+);
+assert.compareArray(
+ Object.getOwnPropertyNames(C.prototype),
+ ['constructor', 'a']
+);
+
+reportCompare(0, 0);