test262/test/language/expressions/async-generator/dstr-named-ary-ptrn-rest-no...

41 lines
1.3 KiB
JavaScript
Raw Normal View History

2017-03-18 00:21:20 +01:00
// This file was procedurally generated from the following sources:
// - src/dstr-binding/ary-ptrn-rest-not-final-id.case
// - src/dstr-binding/default/async-gen-func-named-expr.template
/*---
description: Rest element (identifier) may not be followed by any element (async generator named function expression)
esid: sec-asyncgenerator-definitions-evaluation
features: [async-iteration]
flags: [generated, async]
negative:
phase: early
type: SyntaxError
info: |
AsyncGeneratorExpression : async [no LineTerminator here] function * BindingIdentifier
( FormalParameters ) { AsyncGeneratorBody }
[...]
7. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
AsyncGeneratorBody, funcEnv, strict).
[...]
13.3.3 Destructuring Binding Patterns
ArrayBindingPattern[Yield] :
[ Elisionopt BindingRestElement[?Yield]opt ]
[ BindingElementList[?Yield] ]
[ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
---*/
2017-04-29 22:22:24 +02:00
throw "Test262: This statement should not be evaluated.";
2017-03-18 00:21:20 +01:00
var callCount = 0;
var f;
2017-04-06 23:52:56 +02:00
f = async function* h([...x, y]) {
2017-03-18 00:21:20 +01:00
callCount = callCount + 1;
};
f([1, 2, 3]).next().then(() => {
assert.sameValue(callCount, 1, 'invoked exactly once');
}).then($DONE, $DONE);