Debian Codegraph @

js/src/tests/test262/language/expressions/async-generator/generator-created-after-decl-inst.js

raw
1 // Copyright (C) 2018 André Bargull. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
3
4 /*---
5 esid: sec-asyncgenerator-definitions-evaluatebody
6 description: >
7 The generator object is created after FunctionDeclarationInstantiation.
8 info: |
9 14.5.10 Runtime Semantics: EvaluateBody
10
11 1. Perform ? FunctionDeclarationInstantiation(functionObject, argumentsList).
12 2. Let generator be ? OrdinaryCreateFromConstructor(functionObject, "%AsyncGeneratorPrototype%",
13 « [[AsyncGeneratorState]], [[AsyncGeneratorContext]], [[AsyncGeneratorQueue]] »).
14 3. Perform ! AsyncGeneratorStart(generator, FunctionBody).
15 ...
16
17 features: [async-iteration]
18 ---*/
19
20 var g = async function*(a = (g.prototype = null)) {}
21 var oldPrototype = g.prototype;
22 var it = g();
23
24 assert.notSameValue(Object.getPrototypeOf(it), oldPrototype);
25
26 reportCompare(0, 0);