Files
tsgo/testdata/baselines/reference/compiler/awaitInNamespaceExportedClassComputedProperty.js
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

119 lines
1.9 KiB
TypeScript

//// [tests/cases/compiler/awaitInNamespaceExportedClassComputedProperty.ts] ////
//// [awaitInNamespaceExportedClassComputedProperty.ts]
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 {};
//// [awaitInNamespaceExportedClassComputedProperty.js]
var N;
(function (N) {
class A {
[await x]() { }
}
class B {
[await x]() { }
static [await x]() { }
}
N.B = B;
})(N || (N = {}));
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]() { }
}
}
}