diff options
Diffstat (limited to 'src/class-fields/productions/cls-decl-after-same-line-async-method.template')
-rw-r--r-- | src/class-fields/productions/cls-decl-after-same-line-async-method.template | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/class-fields/productions/cls-decl-after-same-line-async-method.template b/src/class-fields/productions/cls-decl-after-same-line-async-method.template new file mode 100644 index 000000000..62b48966f --- /dev/null +++ b/src/class-fields/productions/cls-decl-after-same-line-async-method.template @@ -0,0 +1,33 @@ +// 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/statements/class/fields-same-line-async-method- +name: field definitions after an async method in the same line +features: [class-fields, async-functions] +flags: [async] +esid: prod-FieldDefinition +includes: [propertyHelper.js] +---*/ + +class C { + 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().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); |