Bug 1892041 - Part 2: Update test262. r=spidermonkey-reviewers,dminor
[gecko.git] / js / src / tests / test262 / language / module-code / eval-gtbndng-local-bndng-var.js
blobb6a29e20ba1b5ae3e2d5c8eae9d012df3cec4473
1 // |reftest| module
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.
4 /*---
5 description: References to local `var` bindings resolve successfully
6 esid: sec-moduleevaluation
7 info: |
8     8.1.1.5.1 GetBindingValue (N, S)
10     [...]
11     3. If the binding for N is an indirect binding, then
12        [...]
13     5. Return the value currently bound to N in envRec.
16     15.2.1.16.4 ModuleDeclarationInstantiation( )
18     [...]
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.
26     [...]
28     13.3.2.4 Runtime Semantics: Evaluation
30     VariableDeclaration : BindingIdentifier Initializer
32     [...]
33     6. Return ? PutValue(lhs, value).
34 flags: [module]
35 ---*/
37 var varBinding = 1;
38 assert.sameValue(varBinding, 1);
40 varBinding = 2;
41 assert.sameValue(varBinding, 2);
43 reportCompare(0, 0);