Debian Codegraph @

js/src/tests/test262/language/expressions/async-generator/named-yield-identifier-spread-strict-strict.js

raw
1 // |reftest| error:SyntaxError
2 'use strict';
3 // This file was procedurally generated from the following sources:
4 // - src/async-generators/yield-identifier-spread-strict.case
5 // - src/async-generators/default/async-expression-named.template
6 /*---
7 description: It's an early error if the AssignmentExpression is a function body with yield as an identifier in strict mode. (Named async generator expression)
8 esid: prod-AsyncGeneratorExpression
9 features: [object-spread, async-iteration]
10 flags: [generated, onlyStrict]
11 negative:
12 phase: parse
13 type: SyntaxError
14 info: |
15 Async Generator Function Definitions
16
17 AsyncGeneratorExpression :
18 async [no LineTerminator here] function * BindingIdentifier ( FormalParameters ) {
19 AsyncGeneratorBody }
20
21
22 Spread Properties
23
24 PropertyDefinition[Yield]:
25 (...)
26 ...AssignmentExpression[In, ?Yield]
27
28 ---*/
29 $DONOTEVALUATE();
30
31
32 var callCount = 0;
33
34 var gen = async function *g() {
35 callCount += 1;
36 return {
37 ...(function() {
38 var yield;
39 throw new Test262Error();
40 }()),
41 }
42 };
43
44 var iter = gen();
45
46
47
48 assert.sameValue(callCount, 1);