mirror of
https://github.com/swc-project/swc.git
synced 2024-12-18 19:21:33 +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
43 lines
977 B
TypeScript
43 lines
977 B
TypeScript
// @module: system
|
|
// @target: esnext
|
|
// @useDefineForClassFields: false
|
|
|
|
// @filename: 0.ts
|
|
export class B {
|
|
print() { return "I am B"}
|
|
}
|
|
|
|
export function foo() { return "foo" }
|
|
|
|
// @filename: 1.ts
|
|
export function backup() { return "backup"; }
|
|
|
|
// @filename: 2.ts
|
|
declare var console: any;
|
|
class C {
|
|
private myModule = import("./0");
|
|
method() {
|
|
const loadAsync = import("./0");
|
|
this.myModule.then(Zero => {
|
|
console.log(Zero.foo());
|
|
}, async err => {
|
|
console.log(err);
|
|
let one = await import("./1");
|
|
console.log(one.backup());
|
|
});
|
|
}
|
|
}
|
|
|
|
export class D {
|
|
private myModule = import("./0");
|
|
method() {
|
|
const loadAsync = import("./0");
|
|
this.myModule.then(Zero => {
|
|
console.log(Zero.foo());
|
|
}, async err => {
|
|
console.log(err);
|
|
let one = await import("./1");
|
|
console.log(one.backup());
|
|
});
|
|
}
|
|
} |