Bug 1892041 - Part 2: Update test262. r=spidermonkey-reviewers,dminor
[gecko.git] / js / src / tests / test262 / language / module-code / eval-gtbndng-indirect-update.js
blobbf67e4df3e88b65e78630d3ae7ac33fb6c27847e
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: >
6     Modifications to named bindings that occur after dependency has been
7     evaluated are reflected in local binding
8 esid: sec-moduleevaluation
9 info: |
10     8.1.1.5.1 GetBindingValue (N, S)
12     [...]
13     3. If the binding for N is an indirect binding, then
14        a. Let M and N2 be the indirection values provided when this binding for
15           N was created.
16        b. Let targetEnv be M.[[Environment]].
17        c. If targetEnv is undefined, throw a ReferenceError exception.
18        d. Let targetER be targetEnv's EnvironmentRecord.
19        e. Return ? targetER.GetBindingValue(N2, S).
20 includes: [fnGlobalObject.js]
21 flags: [module]
22 ---*/
24 import { x } from './eval-gtbndng-indirect-update_FIXTURE.js';
26 assert.sameValue(x, 1);
28 // This function is exposed on the global scope (instead of as an exported
29 // binding) in order to avoid possible false positives from assuming correct
30 // behavior of the semantics under test.
31 fnGlobalObject().test262update();
33 assert.sameValue(x, 2);
35 reportCompare(0, 0);