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: A single namespace is created for each module
6 esid: sec-moduledeclarationinstantiation
9 12. For each ImportEntry Record in in module.[[ImportEntries]], do
10 a. Let importedModule be ? HostResolveImportedModule(module,
11 in.[[ModuleRequest]]).
12 b. If in.[[ImportName]] is "*", then
13 i. Let namespace be ? GetModuleNamespace(importedModule).
14 ii. Perform ! envRec.CreateImmutableBinding(in.[[LocalName]], true).
15 iii. Call envRec.InitializeBinding(in.[[LocalName]], namespace).
18 15.2.1.18 Runtime Semantics: GetModuleNamespace
20 1. Assert: module is an instance of a concrete subclass of Module Record.
21 2. Let namespace be module.[[Namespace]].
22 3. If namespace is undefined, then
28 import * as self1 from './instn-star-equality.js';
29 import * as self2 from './instn-star-equality.js';
30 import * as other1 from './instn-star-equality-other_FIXTURE.js';
31 import * as self3 from './instn-star-equality.js';
32 import * as other2 from './instn-star-equality-other_FIXTURE.js';
33 import { testNs } from './instn-star-equality-other_FIXTURE.js';
36 self1, self2, 'Local namespace objects from consecutive declarations'
39 self1, self3, 'Local namespace objects from non-consective declarations'
41 assert.sameValue(other1, other2, 'External namespace objects');
42 assert.sameValue(self1, testNs, 'Re-exported namespace objects');
44 assert.notSameValue(self1, other1);