fix: push exported variable when hoisting export declared names (#12110)

This commit is contained in:
Huáng Jùnliàng
2020-09-28 11:38:39 -04:00
committed by GitHub
parent a080c82777
commit 62df8d2b79
5 changed files with 9 additions and 10 deletions

View File

@@ -506,9 +506,11 @@ export default declare((api, options) => {
path,
(id, name, hasInit) => {
variableIds.push(id);
if (!hasInit) {
exportNames.push(name);
exportValues.push(scope.buildUndefinedNode());
if (!hasInit && name in exportMap) {
for (const exported of exportMap[name]) {
exportNames.push(exported);
exportValues.push(scope.buildUndefinedNode());
}
}
},
null,