mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
30 lines
574 B
TypeScript
30 lines
574 B
TypeScript
//// [tests/cases/compiler/awaitInClassInAsyncFunction.ts] ////
|
|
|
|
//// [awaitInClassInAsyncFunction.ts]
|
|
// https://github.com/microsoft/TypeScript/issues/34887
|
|
|
|
async function bar() {
|
|
return 2;
|
|
}
|
|
|
|
async function foo() {
|
|
return new class {
|
|
baz = await bar();
|
|
};
|
|
}
|
|
|
|
|
|
//// [awaitInClassInAsyncFunction.js]
|
|
"use strict";
|
|
// https://github.com/microsoft/TypeScript/issues/34887
|
|
async function bar() {
|
|
return 2;
|
|
}
|
|
async function foo() {
|
|
return new class {
|
|
constructor() {
|
|
this.baz = await bar();
|
|
}
|
|
};
|
|
}
|