summaryrefslogtreecommitdiff
path: root/test/language/statements/class/definition/methods-gen-yield-as-label.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/language/statements/class/definition/methods-gen-yield-as-label.js')
-rw-r--r--test/language/statements/class/definition/methods-gen-yield-as-label.js17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/language/statements/class/definition/methods-gen-yield-as-label.js b/test/language/statements/class/definition/methods-gen-yield-as-label.js
new file mode 100644
index 000000000..094f90ac7
--- /dev/null
+++ b/test/language/statements/class/definition/methods-gen-yield-as-label.js
@@ -0,0 +1,17 @@
+// Copyright (C) 2013 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+ description: >
+ `yield` is a reserved keyword within generator function bodies and may
+ not be used as a label.
+ features: [generators]
+ es6id: 12.1.1
+ negative: SyntaxError
+ ---*/
+
+class A {
+ *g() {
+ yield: 1;
+ }
+}