-
Notifications
You must be signed in to change notification settings - Fork 464
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
export-ns: default skipped for nested namespace
- Loading branch information
Valerie R Young
committed
Apr 20, 2018
1 parent
fda0020
commit b33324a
Showing
5 changed files
with
61 additions
and
0 deletions.
There are no files selected for viewing
6 changes: 6 additions & 0 deletions
6
...guage/module-code/namespace/internals/get-nested-namespace-dflt-skip-named-end_FIXTURE.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// Copyright (C) 2018 Valerie Young. All rights reserved. | ||
// This code is governed by the BSD license found in the LICENSE file. | ||
|
||
var x; | ||
export var namedOther = null; | ||
export { x as default }; |
5 changes: 5 additions & 0 deletions
5
...nguage/module-code/namespace/internals/get-nested-namespace-dflt-skip-prod-end_FIXTURE.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
// Copyright (C) 2018 Valerie Young. All rights reserved. | ||
// This code is governed by the BSD license found in the LICENSE file. | ||
|
||
export var productionOther = null; | ||
export default null; |
4 changes: 4 additions & 0 deletions
4
test/language/module-code/namespace/internals/get-nested-namespace-dflt-skip-prod_FIXTURE.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
// Copyright (C) 2018 Valerie Young. All rights reserved. | ||
// This code is governed by the BSD license found in the LICENSE file. | ||
|
||
export * as productionns2 from './instn-nested-namespace-dflt-skip-prod_FIXTURE.js'; |
42 changes: 42 additions & 0 deletions
42
test/language/module-code/namespace/internals/get-nested-namespace-dflt-skip.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// 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 not 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] | ||
---*/ | ||
|
||
import * as namedns1 from './instn-nested-namespace-dtlf-skip-named_FIXTURE.js'; | ||
import * as productionns1 from './instn-nested-namespace-dflt-skip-prod_FIXTURE.js'; | ||
|
||
assert('namedOther' in namedns1.namedns2); | ||
assert.sameValue( | ||
'default' in namedns1.namedns2, false, 'default specified via identifier' | ||
); | ||
|
||
assert('productionOther' in productionns1.productionns2); | ||
assert.sameValue( | ||
'default' in productionns1.productionns2, false, 'default specified via dedicated production' | ||
); |
4 changes: 4 additions & 0 deletions
4
.../language/module-code/namespace/internals/get-nested-namespace-dtlf-skip-named_FIXTURE.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
// Copyright (C) 2018 Valerie Young. All rights reserved. | ||
// This code is governed by the BSD license found in the LICENSE file. | ||
|
||
export * as namedns2 from './instn-nested-namespace-dflt-skip-named-end_FIXTURE.js'; |