Debian Codegraph @

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

raw
1 // This file was procedurally generated from the following sources:
2 // - src/async-generators/yield-identifier-strict.case
3 // - src/async-generators/default/async-class-expr-method.template
4 /*---
5 description: It's an early error if the generator body has another function body with yield as an identifier in strict mode. (Async generator method as a ClassExpression element)
6 esid: prod-AsyncGeneratorMethod
7 features: [async-iteration]
8 flags: [generated, onlyStrict]
9 negative:
10 phase: parse
11 type: SyntaxError
12 info: |
13 ClassElement :
14 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 throw "Test262: This statement should not be evaluated.";
26
27
28 var callCount = 0;
29
30 var C = class { async *gen() {
31 callCount += 1;
32 (function() {
33 var yield;
34 throw new Test262Error();
35 }())
36 }}
37
38 var gen = C.prototype.gen;
39
40 var iter = gen();
41
42
43
44 assert.sameValue(callCount, 1);