generator-created-after-decl-inst.js (844B)
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-generator-function-definitions-runtime-semantics-evaluatebody 6 description: > 7 The generator object is created after FunctionDeclarationInstantiation. 8 info: | 9 14.4.10 Runtime Semantics: EvaluateBody 10 11 1. Perform ? FunctionDeclarationInstantiation(functionObject, argumentsList). 12 2. Let G be ? OrdinaryCreateFromConstructor(functionObject, "%GeneratorPrototype%", 13 « [[GeneratorState]], [[GeneratorContext]] »). 14 3. Perform GeneratorStart(G, FunctionBody). 15 ... 16 17 features: [generators] 18 ---*/ 19 20 var g = 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);