fix: push exported variable when hoisting export declared names (#12110)
This commit is contained in:
parent
a080c82777
commit
62df8d2b79
@ -506,10 +506,12 @@ export default declare((api, options) => {
|
||||
path,
|
||||
(id, name, hasInit) => {
|
||||
variableIds.push(id);
|
||||
if (!hasInit) {
|
||||
exportNames.push(name);
|
||||
if (!hasInit && name in exportMap) {
|
||||
for (const exported of exportMap[name]) {
|
||||
exportNames.push(exported);
|
||||
exportValues.push(scope.buildUndefinedNode());
|
||||
}
|
||||
}
|
||||
},
|
||||
null,
|
||||
);
|
||||
|
||||
@ -3,7 +3,7 @@ System.register([], function (_export, _context) {
|
||||
|
||||
var foo;
|
||||
|
||||
_export("foo", void 0);
|
||||
_export("bar", void 0);
|
||||
|
||||
return {
|
||||
setters: [],
|
||||
|
||||
@ -3,7 +3,7 @@ System.register([], function (_export, _context) {
|
||||
|
||||
var foo;
|
||||
|
||||
_export("foo", void 0);
|
||||
_export("default", void 0);
|
||||
|
||||
return {
|
||||
setters: [],
|
||||
|
||||
@ -4,7 +4,7 @@ System.register([], function (_export, _context) {
|
||||
var foo, bar;
|
||||
|
||||
_export({
|
||||
foo: void 0,
|
||||
default: void 0,
|
||||
bar: void 0
|
||||
});
|
||||
|
||||
|
||||
@ -7,10 +7,7 @@ System.register(["./evens"], function (_export, _context) {
|
||||
return _export("p", p = isEven(n) ? n + 1 : n + 2);
|
||||
}
|
||||
|
||||
_export({
|
||||
nextOdd: nextOdd,
|
||||
a: void 0
|
||||
});
|
||||
_export("nextOdd", nextOdd);
|
||||
|
||||
return {
|
||||
setters: [function (_evens) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user