Skip to content

Commit

Permalink
export-ns: case for runtime error when importing default from * as
Browse files Browse the repository at this point in the history
  • Loading branch information
Valerie R Young committed Mar 21, 2018
1 parent 5ddaab7 commit 247131c
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 0 deletions.
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 };
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';
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';

0 comments on commit 247131c

Please sign in to comment.