Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/language/expressions/class/async-gen-method-static-yield-identifier-spread-strict.js

raw
1 // This file was procedurally generated from the following sources:
2 // - src/async-generators/yield-identifier-spread-strict.case
3 // - src/async-generators/default/async-class-expr-static-method.template
4 /*---
5 description: It's an early error if the AssignmentExpression is a function body with yield as an identifier in strict mode. (Static async generator method as a ClassExpression element)
6 esid: prod-AsyncGeneratorMethod
7 features: [object-spread, async-iteration]
8 flags: [generated, onlyStrict]
9 negative:
10 phase: parse
11 type: SyntaxError
12 info: |
13 ClassElement :
14 static MethodDefinition
15
16 MethodDefinition :
17 AsyncGeneratorMethod
18
19 Async Generator Function Definitions
20
21 AsyncGeneratorMethod :
22 async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
23
24
25 Spread Properties
26
27 PropertyDefinition[Yield]:
28 (...)
29 ...AssignmentExpression[In, ?Yield]
30
31 ---*/
32 throw "Test262: This statement should not be evaluated.";
33
34
35 var callCount = 0;
36
37 var C = class { static async *gen() {
38 callCount += 1;
39 return {
40 ...(function() {
41 var yield;
42 throw new Test262Error();
43 }()),
44 }
45 }}
46
47 var gen = C.gen;
48
49 var iter = gen();
50
51
52
53 assert.sameValue(callCount, 1);