Files
tsgo/testdata/tests/cases/compiler/awaitInNamespaceExportedClassComputedProperty.ts
8e53cbee81 Preserve await context for exported classes in nested containers (#4823)
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: RyanCavanaugh <[email protected]>
Co-authored-by: Ryan Cavanaugh <[email protected]>
2026-08-10 19:56:19 +00:00

58 lines
818 B
TypeScript

// @target: esnext
// @module: esnext
declare const x: string;
namespace N {
class A { [await x]() {} }
export class B {
[await x]() {}
static [await x]() {}
}
}
export class C {
[await x]() {}
static [await x]() {}
}
{
class D { [await x]() {} }
}
function f() {
class E {
[await x]() {}
static [await x]() {}
}
}
async function af() {
class F {
[await x]() {}
static [await x]() {}
}
}
function* gf() {
class G { [await x]() {} }
}
async function* agf() {
class H { [await x]() {} }
}
function switchSync() {
switch (0) {
case 0:
class I { [await x]() {} }
}
}
async function switchAsync() {
switch (0) {
case 0:
class J { [await x]() {} }
}
}
export {};