swc/tests/fixture/issue-1729/case2/output/index.ts
강동윤 a518c83485
fix(es): Fix bugs (#1728)
swc_ecma_transforms_compat:
 - `block_scoping`: Ensure that #1462 is fixed. (#1462)
 - `regenerator`: Inject variables at proper level. (#1718)

swc_ecam_transforms_typescript:
 - `strip`: Handle class expressions in arrow expressions correctly. (#1729)
2021-05-22 12:14:00 +09:00

14 lines
286 B
TypeScript

function createConstructor(callback) {
let klass;
return (...args)=>{
if (klass === undefined) {
klass = callback();
}
return new klass(...args);
};
}
const constructor = createConstructor(()=>class {
}
);
console.log(constructor());