forked from BrowserWorks/Waterfox-Classic
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 1496852 - Support JavaScript export-ns-from syntax r=jorendorff
Add support for `export * as ns from "a";` syntax. This was added in ECMAScript 2020. One wrinkle in the implementation is that the parser decides whether to use a lexical vs indirect binding before module linking. Instead, we reserve a hidden environment slot called "*namespace*" for each module that can be referenced by indirect binding maps as needed. Spec is a needs-consensus PR at tc39/ecma262#1174 Depends on D80984 Differential Revision: https://phabricator.services.mozilla.com/D80777
- Loading branch information
1 parent
d7e084e
commit b6b2233
Showing
10 changed files
with
124 additions
and
17 deletions.
There are no files selected for viewing
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
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
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
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
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
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 @@ | ||
export * as ns from "module1.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,10 @@ | ||
// |jit-test| module | ||
|
||
import { ns } from "export-ns.js"; | ||
|
||
load(libdir + 'asserts.js'); | ||
|
||
assertEq(isProxy(ns), true); | ||
assertEq(ns.a, 1); | ||
assertThrowsInstanceOf(function() { eval("delete ns"); }, SyntaxError); | ||
assertThrowsInstanceOf(function() { ns = null; }, TypeError); |
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
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
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