diff options
Diffstat (limited to 'js/src/tests/test262/language/expressions/object/dstr/async-gen-meth-obj-ptrn-rest-skip-non-enumerable.js')
-rw-r--r-- | js/src/tests/test262/language/expressions/object/dstr/async-gen-meth-obj-ptrn-rest-skip-non-enumerable.js | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/js/src/tests/test262/language/expressions/object/dstr/async-gen-meth-obj-ptrn-rest-skip-non-enumerable.js b/js/src/tests/test262/language/expressions/object/dstr/async-gen-meth-obj-ptrn-rest-skip-non-enumerable.js new file mode 100644 index 0000000000..3df62c76c6 --- /dev/null +++ b/js/src/tests/test262/language/expressions/object/dstr/async-gen-meth-obj-ptrn-rest-skip-non-enumerable.js @@ -0,0 +1,54 @@ +// |reftest| async +// This file was procedurally generated from the following sources: +// - src/dstr-binding/obj-ptrn-rest-skip-non-enumerable.case +// - src/dstr-binding/default/async-gen-meth.template +/*--- +description: Rest object doesn't contain non-enumerable properties (async generator method) +esid: sec-asyncgenerator-definitions-propertydefinitionevaluation +features: [object-rest, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + AsyncGeneratorMethod : + async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) + { AsyncGeneratorBody } + + 1. Let propKey be the result of evaluating PropertyName. + 2. ReturnIfAbrupt(propKey). + 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true. + Otherwise let strict be false. + 4. Let scope be the running execution context's LexicalEnvironment. + 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters, + AsyncGeneratorBody, scope, strict). + [...] + +---*/ +var o = {a: 3, b: 4}; +Object.defineProperty(o, "x", { value: 4, enumerable: false }); + + +var callCount = 0; +var obj = { + async *method({...rest}) { + assert.sameValue(rest.x, undefined); + + verifyProperty(rest, "a", { + enumerable: true, + writable: true, + configurable: true, + value: 3 + }); + + verifyProperty(rest, "b", { + enumerable: true, + writable: true, + configurable: true, + value: 4 + }); + callCount = callCount + 1; + } +}; + +obj.method(o).next().then(() => { + assert.sameValue(callCount, 1, 'invoked exactly once'); +}).then($DONE, $DONE); |