Closed Bug 1496852 Opened 4 years ago Closed 2 years ago

Implement export-ns-from syntax

Categories

(Core :: JavaScript Engine, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
mozilla80
Tracking Status
firefox80 --- fixed

People

(Reporter: john.david.dalton, Assigned: tcampbell)

References

(Blocks 1 open bug)

Details

(Keywords: dev-doc-complete)

Attachments

(2 files)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36

Steps to reproduce:

Now that export-ns-from has TC39 consensus (https://github.com/tc39/ecma262/pull/1174#issuecomment-425120082) the TC39 is looking for engines to implement.
Component: Untriaged → JavaScript Engine
Product: Firefox → Core
Status: UNCONFIRMED → NEW
Ever confirmed: true
Apparently v8 implemented this behind a flag, and Chakra is in progress. How difficult is this to implement?
Flags: needinfo?(jcoppeard)
I suspect it's not too difficult.  Are you interested in working on this?
Flags: needinfo?(jcoppeard)
Priority: -- → P3

This was just accepted for merging into the spec, so we should probably up the priority of implementing it.

Flags: needinfo?(jcoppeard)

I'm making an attempt at this as I fix Bug 1614041.

Assignee: nobody → tcampbell

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.

Flags: needinfo?(jcoppeard)

Update spec references and step numbers to match ES2020. Add TODOs for the
missing steps. There are some editorial changes in latest draft that affect
step numbers, but behaviour is the same for these methods.

Pushed by tcampbell@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/6fee4a3c8aa4
Update spec references in Module.js r=jorendorff
https://hg.mozilla.org/integration/autoland/rev/a35461d1fc07
Support JavaScript export-ns-from syntax r=jorendorff
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla80
You need to log in before you can comment on or make changes to this bug.