mirror of
https://github.com/swc-project/swc.git
synced 2024-12-21 12:41:54 +03:00
b887b30092
**Description:** This is required for https://github.com/swc-project/swc/pull/6981 and https://github.com/swc-project/swc/pull/6950
19 lines
389 B
TypeScript
19 lines
389 B
TypeScript
// @module: commonjs
|
|
// @target: esnext
|
|
// @filename: 0.ts
|
|
export function foo() { return "foo"; }
|
|
|
|
// @filename: 1.ts
|
|
export function backup() { return "backup"; }
|
|
|
|
// @filename: 2.ts
|
|
async function compute(promise: Promise<any>) {
|
|
let j = await promise;
|
|
if (!j) {
|
|
j = await import("./1");
|
|
return j.backup();
|
|
}
|
|
return j.foo();
|
|
}
|
|
|
|
compute(import("./0")); |