mirror of
https://github.com/swc-project/swc.git
synced 2024-11-24 10:12:42 +03:00
fix(bundler): Handle star export with top-level await
(#5707)
This commit is contained in:
parent
00dde3eed2
commit
2b7cba8a97
@ -370,6 +370,13 @@ where
|
||||
Callee::Super(_) | Callee::Import(_) => continue,
|
||||
Callee::Expr(v) => v,
|
||||
},
|
||||
Expr::Await(AwaitExpr { arg, .. }) => match &mut **arg {
|
||||
Expr::Call(CallExpr { callee, .. }) => match callee {
|
||||
Callee::Super(_) | Callee::Import(_) => continue,
|
||||
Callee::Expr(v) => v,
|
||||
},
|
||||
_ => continue,
|
||||
},
|
||||
_ => continue,
|
||||
},
|
||||
None => continue,
|
||||
|
@ -0,0 +1,2 @@
|
||||
await Promise.resolve(true);
|
||||
export * from "./lib1";
|
@ -0,0 +1,2 @@
|
||||
import * as lib from "./deps";
|
||||
console.log(lib);
|
@ -0,0 +1 @@
|
||||
export const starExport = 1;
|
@ -0,0 +1,7 @@
|
||||
await Promise.resolve(true);
|
||||
const mod = await async function() {
|
||||
return {
|
||||
starExport: 1
|
||||
};
|
||||
}();
|
||||
console.log(mod);
|
@ -0,0 +1,8 @@
|
||||
const starExport = 1;
|
||||
await Promise.resolve(true);
|
||||
const mod = await async function() {
|
||||
return {
|
||||
starExport
|
||||
};
|
||||
}();
|
||||
console.log(mod);
|
Loading…
Reference in New Issue
Block a user