Bug 1892041 - Part 2: Update test262. r=spidermonkey-reviewers,dminor
[gecko.git] / js / src / tests / test262 / language / module-code / instn-star-as-props-dflt-skip.js
blob9920601ca8e56d926fbd630ea9b9d67871fa252a
1 // |reftest| module
2 // Copyright (C) 2018 Valerie Young. All rights reserved.
3 // This code is governed by the BSD license found in the LICENSE file.
4 /*---
5 description: >
6   Default exports are included in an imported module namespace object when module exported with `* as namespace`
7 esid: sec-moduledeclarationinstantiation
8 info: |
9   [...]
10   4. Let result be InnerModuleInstantiation(module, stack, 0).
11   [...]
13   InnerModuleInstantiation( module, stack, index )
14   [...]
15   10. Perform ? ModuleDeclarationEnvironmentSetup(module).
16   [...]
18   ModuleDeclarationEnvironmentSetup( module )
19   [...]
20     c. If in.[[ImportName]] is "*", then
21     [...]
22     d. Else,
23       i. Let resolution be ? importedModule.ResolveExport(in.[[ImportName]], « »).
24       ii. If resolution is null or "ambiguous", throw a SyntaxError exception.
25       iii. If resolution.[[BindingName]] is "*namespace*", then
26         1. Let namespace be ? GetModuleNamespace(resolution.[[Module]]).
27     [...]
29   15.2.1.18 Runtime Semantics: GetModuleNamespace
31   [...]
32   3. If namespace is undefined, then
33   a. Let exportedNames be ? module.GetExportedNames(« »).
34   [...]
36   15.2.1.16.2 GetExportedNames
38   [...]
39   7. For each ExportEntry Record e in module.[[StarExportEntries]], do
40   [...]
41   c. For each element n of starNames, do
42   i. If SameValue(n, "default") is false, then
43   [...]
44 flags: [module]
45 features: [export-star-as-namespace-from-module]
46 ---*/
48 import {named} from './instn-star-props-dflt-skip-star-as-named_FIXTURE.js';
49 import {production} from './instn-star-props-dflt-skip-star-as-prod_FIXTURE.js';
51 assert('namedOther' in named);
52 assert.sameValue(
53   'default' in named, true, 'default specified via identifier'
56 assert('productionOther' in production);
57 assert.sameValue(
58   'default' in production, true, 'default specified via dedicated production'
61 reportCompare(0, 0);