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: Immutable binding is created for module namespace object
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).
21 typeof ns, 'object', 'binding is initialized prior to module evaluation'
26 assert.throws(TypeError, function() {
28 }, 'binding rejects assignment');
30 assert.sameValue(ns, original, 'binding value is immutable');
32 import * as ns from './instn-star-binding.js';