summaryrefslogtreecommitdiff
path: root/src/class-fields/productions/cls-expr-after-same-line-async-gen.template
diff options
context:
space:
mode:
Diffstat (limited to 'src/class-fields/productions/cls-expr-after-same-line-async-gen.template')
-rw-r--r--src/class-fields/productions/cls-expr-after-same-line-async-gen.template34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/class-fields/productions/cls-expr-after-same-line-async-gen.template b/src/class-fields/productions/cls-expr-after-same-line-async-gen.template
new file mode 100644
index 000000000..a86b3256a
--- /dev/null
+++ b/src/class-fields/productions/cls-expr-after-same-line-async-gen.template
@@ -0,0 +1,34 @@
+// 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.
+
+/*---
+path: language/expressions/class/fields-same-line-async-gen-
+name: field definitions after an async generator in the same line
+features: [class-fields, async-iteration]
+flags: [async]
+esid: prod-FieldDefinition
+includes: [propertyHelper.js]
+---*/
+
+var C = class {
+ async *m() { return 42; } /*{ fields }*/;
+/*{ privateinspectionfunctions }*/
+}
+
+var c = new C();
+
+assert.sameValue(Object.hasOwnProperty.call(c, "m"), false);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+/*{ assertions }*/
+
+c.m().next().then(function(v) {
+ assert.sameValue(v.value, 42);
+ assert.sameValue(v.done, true);
+}, $DONE).then($DONE, $DONE);