-
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: case for runtime error when importing default from * as
- Loading branch information
Valerie R Young
committed
Mar 21, 2018
1 parent
5ddaab7
commit 247131c
Showing
3 changed files
with
36 additions
and
0 deletions.
There are no files selected for viewing
5 changes: 5 additions & 0 deletions
5
test/language/module-code/instn-iee-err-dflt-thru-star-as-namespace-dflt_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. | ||
|
||
var x; | ||
export { x as default }; |
4 changes: 4 additions & 0 deletions
4
test/language/module-code/instn-iee-err-dflt-thru-star-as-namespace-int_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 namespace from './instn-iee-err-dflt-thru-star-namespace-dflt_FIXTURE.js'; |
27 changes: 27 additions & 0 deletions
27
test/language/module-code/instn-iee-err-dflt-thru-star-as-namespace.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,27 @@ | ||
// Copyright (C) 2018 Valerie Young. All rights reserved. | ||
// This code is governed by the BSD license found in the LICENSE file. | ||
/*--- | ||
description: IndirectExportEntries validation - default not found (excluding * as namespace) | ||
esid: sec-moduledeclarationinstantiation | ||
info: | | ||
[...] | ||
9. For each ExportEntry Record e in module.[[IndirectExportEntries]], do | ||
a. Let resolution be ? module.ResolveExport(e.[[ExportName]], « », « »). | ||
b. If resolution is null or resolution is "ambiguous", throw a | ||
SyntaxError exception. | ||
[...] | ||
15.2.1.16.3 ResolveExport | ||
[...] | ||
6. If SameValue(exportName, "default") is true, then | ||
a. Assert: A default export was not explicitly defined by this module. | ||
b. Throw a SyntaxError exception. | ||
c. NOTE A default export cannot be provided by an export *. | ||
negative: | ||
phase: runtime | ||
type: SyntaxError | ||
flags: [module] | ||
---*/ | ||
|
||
export { default as x } from './instn-iee-err-dflt-thru-star-as-namespace-int_FIXTURE.js'; |