instn-named-bndng-dflt-expr.js (1415B)
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 Imported binding reflects state of exported default binding (expressions) 7 esid: sec-moduledeclarationinstantiation 8 info: | 9 [...] 10 12. For each ImportEntry Record in in module.[[ImportEntries]], do 11 a. Let importedModule be ? HostResolveImportedModule(module, 12 in.[[ModuleRequest]]). 13 b. If in.[[ImportName]] is "*", then 14 [...] 15 c. Else, 16 i. Let resolution be ? 17 importedModule.ResolveExport(in.[[ImportName]], « », « »). 18 ii. If resolution is null or resolution is "ambiguous", throw a 19 SyntaxError exception. 20 iii. Call envRec.CreateImportBinding(in.[[LocalName]], 21 resolution.[[Module]], resolution.[[BindingName]]). 22 [...] 23 24 8.1.1.5.5 CreateImportBinding 25 26 [...] 27 5. Create an immutable indirect binding in envRec for N that references M 28 and N2 as its target binding and record that the binding is initialized. 29 6. Return NormalCompletion(empty). 30 flags: [module] 31 ---*/ 32 33 assert.throws(ReferenceError, function() { 34 typeof dflt; 35 }, 'binding is created but not initialized'); 36 37 import dflt from './instn-named-bndng-dflt-expr.js'; 38 export default (function() {}); 39 40 reportCompare(0, 0);