Hoist initial assignment to exported names in cjs to they are not blocked by bindings made by __exportStar - #37093
Merged
Wesley Wigham (weswigham) merged 4 commits intoFeb 28, 2020
Conversation
…cked by bindings made by __exportStar
Wesley Wigham (weswigham)
force-pushed
the
exportstar-skip-locals
branch
from
February 28, 2020 00:46
ece0b05 to
44bbf14
Compare
Ron Buckton (rbuckton)
approved these changes
Feb 28, 2020
Ron Buckton (rbuckton)
left a comment
Contributor
There was a problem hiding this comment.
May need to discuss in design meeting.
Oscar Busk (oBusk)
added a commit
to oBusk/walkable-buffer
that referenced
this pull request
May 13, 2020
|
Missed the case of exported namespace (export * as foo from 'foo'). |
We need this because now that
__createBindingis used by__exportStarto create live-updating getters, if you had input likewe'd output
the assignment will throw because the
__exportStarmade a getter which can't be overridden with a simple assignment. By emittingwe prevent
__exportStarfrom overwritingnameFromModwith a getter (so the assignment succeeds).This also neatly ensures all export names are available to reexport when resolving within a circular module graph.