diff options
Diffstat (limited to '')
-rw-r--r-- | js/src/tests/test262/language/module-code/namespace/internals/get-nested-namespace-dflt-skip.js | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/js/src/tests/test262/language/module-code/namespace/internals/get-nested-namespace-dflt-skip.js b/js/src/tests/test262/language/module-code/namespace/internals/get-nested-namespace-dflt-skip.js new file mode 100644 index 0000000000..41bb7933bb --- /dev/null +++ b/js/src/tests/test262/language/module-code/namespace/internals/get-nested-namespace-dflt-skip.js @@ -0,0 +1,46 @@ +// |reftest| module +// Copyright (C) 2018 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +description: > + Default exports are included in an imported module namespace object when a namespace object is created. +esid: sec-module-namespace-exotic-objects-get-p-receiver +info: | + [...] + 6. Let binding be ! m.ResolveExport(P, « »). + 7. Assert: binding is a ResolvedBinding Record. + 8. Let targetModule be binding.[[Module]]. + 9. Assert: targetModule is not undefined. + 10. If binding.[[BindingName]] is "*namespace*", then + 11. Return ? GetModuleNamespace(targetModule). + + Runtime Semantics: GetModuleNamespace + [...] + 3. If namespace is undefined, then + a. Let exportedNames be ? module.GetExportedNames(« »). + b. Let unambiguousNames be a new empty List. + c. For each name that is an element of exportedNames, + i. Let resolution be ? module.ResolveExport(name, « », « »). + ii. If resolution is null, throw a SyntaxError exception. + iii. If resolution is not "ambiguous", append name to + unambiguousNames. + d. Let namespace be ModuleNamespaceCreate(module, unambiguousNames). + [...] +flags: [module] +features: [export-star-as-namespace-from-module] +---*/ + +import * as namedns1 from './get-nested-namespace-dflt-skip-named_FIXTURE.js'; +import * as productionns1 from './get-nested-namespace-dflt-skip-prod_FIXTURE.js'; + +assert('namedOther' in namedns1.namedns2); +assert.sameValue( + 'default' in namedns1.namedns2, true, 'default specified via identifier' +); + +assert('productionOther' in productionns1.productionns2); +assert.sameValue( + 'default' in productionns1.productionns2, true, 'default specified via dedicated production' +); + +reportCompare(0, 0); |