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.
5 description: References to local `var` bindings resolve successfully
6 esid: sec-moduleevaluation
8 8.1.1.5.1 GetBindingValue (N, S)
11 3. If the binding for N is an indirect binding, then
13 5. Return the value currently bound to N in envRec.
16 15.2.1.16.4 ModuleDeclarationInstantiation( )
19 14. Let declaredVarNames be a new empty List.
20 15. For each element d in varDeclarations do
21 a. For each element dn of the BoundNames of d do
22 i. If dn is not an element of declaredVarNames, then
23 1. Perform ! envRec.CreateMutableBinding(dn, false).
24 2. Call envRec.InitializeBinding(dn, undefined).
25 3. Append dn to declaredVarNames.
28 13.3.2.4 Runtime Semantics: Evaluation
30 VariableDeclaration : BindingIdentifier Initializer
33 6. Return ? PutValue(lhs, value).
38 assert.sameValue(varBinding, 1);
41 assert.sameValue(varBinding, 2);