2 // Copyright (C) 2016 the V8 project authors. All rights reserved.
3 // This code is governed by the BSD license found in the LICENSE file.
6 Mutable bindings are initialized in the lexical environment record prior to
7 execution for generator function declarations
8 esid: sec-moduledeclarationinstantiation
11 15. For each element d in varDeclarations do
12 a. For each element dn of the BoundNames of d do
13 i. If dn is not an element of declaredVarNames, then
14 1. Perform ! envRec.CreateMutableBinding(dn, false).
15 2. Call envRec.InitializeBinding(dn, undefined).
16 3. Append dn to declaredVarNames.
18 includes: [fnGlobalObject.js]
22 var global = fnGlobalObject();
25 typeof test262, 'function', 'generator function value is hoisted'
28 test262().next().value,
30 'hoisted generator function value is correct'
33 Object.getOwnPropertyDescriptor(global, 'test262'), undefined
37 assert.sameValue(test262, null, 'binding is mutable');
39 Object.getOwnPropertyDescriptor(global, 'test262'), undefined
42 function* test262() { return 'test262'; }
45 test262, null, 'binding is not effected by evaluation of declaration'
48 Object.getOwnPropertyDescriptor(global, 'test262'),
50 'global binding is not effected by evaluation of declaration'