TypeScript/tests/cases/conformance/classes/awaitAndYieldInProperty.ts
Klaus Meinhardt 5321dcb09f disallow 'await' and 'yield' in property and enum member initializer (#34892)
* disallow 'await' and 'yield' in property and enum member initializer

* accept baseline changes

* Add a test for #34887

Ensures that this fixes #34887
2019-11-14 17:44:48 -08:00

19 lines
399 B
TypeScript

// @target: es2019
// @noTypesAndSymbols: true
async function* test(x: Promise<string>) {
class C {
[await x] = await x;
static [await x] = await x;
[yield 1] = yield 2;
static [yield 3] = yield 4;
}
return class {
[await x] = await x;
static [await x] = await x;
[yield 1] = yield 2;
static [yield 3] = yield 4;
}
}