906cbd2715
* Class static block (#9) * Add types factory and parser * Add some case * Make class static block as a container * Update cases * Add visitor * Add emitter and more compile target * Check boundary of break and continue * Add basic transformer * Fix emit behavior * Add more tests * Add friend tests * Update baseline * Fix cr issues * Accept baseline * Add decorator and modifier check * Add functional boundary check * Fix conflict * Fix computed prop name within context * Add more tests * Update baseline * Avoid invalid test baseline * Support use before initialize check * wip * Fix class static block context * Fix checks * Fix missing case * Improve assert message * Accept baseline * Avoid new context * Update diagnostic message * Fix name collision * Fix targets * Avoid unnecessary files * Add more case * Add more test cases * Fix strict mode function declaration * Avoid private fields initializer if no private identifier references * Avoid private fields and add more test case * Add more case * Add tests and support for related services functionality * Fix this reference in static block * Split parser diagnostic and binder diagnostic Co-authored-by: Ron Buckton <ron.buckton@microsoft.com>
131 lines
4.3 KiB
Plaintext
131 lines
4.3 KiB
Plaintext
=== tests/cases/conformance/classes/classStaticBlock/classStaticBlock22.ts ===
|
|
let await: "any";
|
|
>await : Symbol(await, Decl(classStaticBlock22.ts, 0, 3))
|
|
|
|
class C {
|
|
>C : Symbol(C, Decl(classStaticBlock22.ts, 0, 17))
|
|
|
|
static {
|
|
let await: any; // illegal, cannot declare a new binding for await
|
|
>await : Symbol(await, Decl(classStaticBlock22.ts, 3, 7))
|
|
}
|
|
static {
|
|
let { await } = {} as any; // illegal, cannot declare a new binding for await
|
|
>await : Symbol(await, Decl(classStaticBlock22.ts, 6, 9))
|
|
}
|
|
static {
|
|
let { await: other } = {} as any; // legal
|
|
>other : Symbol(other, Decl(classStaticBlock22.ts, 9, 9))
|
|
}
|
|
static {
|
|
let await; // illegal, cannot declare a new binding for await
|
|
>await : Symbol(await, Decl(classStaticBlock22.ts, 12, 7))
|
|
}
|
|
static {
|
|
function await() { }; // illegal
|
|
>await : Symbol(await, Decl(classStaticBlock22.ts, 14, 10))
|
|
}
|
|
static {
|
|
class await { }; // illegal
|
|
>await : Symbol(await, Decl(classStaticBlock22.ts, 17, 10))
|
|
}
|
|
|
|
static {
|
|
class D {
|
|
>D : Symbol(D, Decl(classStaticBlock22.ts, 21, 10))
|
|
|
|
await = 1; // legal
|
|
>await : Symbol(D.await, Decl(classStaticBlock22.ts, 22, 13))
|
|
|
|
x = await; // legal (initializers have an implicit function boundary)
|
|
>x : Symbol(D.x, Decl(classStaticBlock22.ts, 23, 16))
|
|
>await : Symbol(await, Decl(classStaticBlock22.ts, 0, 3))
|
|
|
|
};
|
|
}
|
|
static {
|
|
(function await() { }); // legal, 'await' in function expression name not bound inside of static block
|
|
>await : Symbol(await, Decl(classStaticBlock22.ts, 28, 5))
|
|
}
|
|
static {
|
|
(class await { }); // legal, 'await' in class expression name not bound inside of static block
|
|
>await : Symbol(await, Decl(classStaticBlock22.ts, 31, 5))
|
|
}
|
|
static {
|
|
(function () { return await; }); // legal, 'await' is inside of a new function boundary
|
|
>await : Symbol(await, Decl(classStaticBlock22.ts, 0, 3))
|
|
}
|
|
static {
|
|
(() => await); // legal, 'await' is inside of a new function boundary
|
|
>await : Symbol(await, Decl(classStaticBlock22.ts, 0, 3))
|
|
}
|
|
|
|
static {
|
|
class E {
|
|
>E : Symbol(E, Decl(classStaticBlock22.ts, 40, 10))
|
|
|
|
constructor() { await; }
|
|
>await : Symbol(await, Decl(classStaticBlock22.ts, 0, 3))
|
|
|
|
method() { await; }
|
|
>method : Symbol(E.method, Decl(classStaticBlock22.ts, 42, 30))
|
|
>await : Symbol(await, Decl(classStaticBlock22.ts, 0, 3))
|
|
|
|
get accessor() {
|
|
>accessor : Symbol(E.accessor, Decl(classStaticBlock22.ts, 43, 25), Decl(classStaticBlock22.ts, 47, 7))
|
|
|
|
await;
|
|
>await : Symbol(await, Decl(classStaticBlock22.ts, 0, 3))
|
|
|
|
return 1;
|
|
}
|
|
set accessor(v: any) {
|
|
>accessor : Symbol(E.accessor, Decl(classStaticBlock22.ts, 43, 25), Decl(classStaticBlock22.ts, 47, 7))
|
|
>v : Symbol(v, Decl(classStaticBlock22.ts, 48, 19))
|
|
|
|
await;
|
|
>await : Symbol(await, Decl(classStaticBlock22.ts, 0, 3))
|
|
}
|
|
propLambda = () => { await; }
|
|
>propLambda : Symbol(E.propLambda, Decl(classStaticBlock22.ts, 50, 7))
|
|
>await : Symbol(await, Decl(classStaticBlock22.ts, 0, 3))
|
|
|
|
propFunc = function () { await; }
|
|
>propFunc : Symbol(E.propFunc, Decl(classStaticBlock22.ts, 51, 35))
|
|
>await : Symbol(await, Decl(classStaticBlock22.ts, 0, 3))
|
|
}
|
|
}
|
|
static {
|
|
class S {
|
|
>S : Symbol(S, Decl(classStaticBlock22.ts, 55, 10))
|
|
|
|
static method() { await; }
|
|
>method : Symbol(S.method, Decl(classStaticBlock22.ts, 56, 13))
|
|
>await : Symbol(await, Decl(classStaticBlock22.ts, 0, 3))
|
|
|
|
static get accessor() {
|
|
>accessor : Symbol(S.accessor, Decl(classStaticBlock22.ts, 57, 32), Decl(classStaticBlock22.ts, 61, 7))
|
|
|
|
await;
|
|
>await : Symbol(await, Decl(classStaticBlock22.ts, 0, 3))
|
|
|
|
return 1;
|
|
}
|
|
static set accessor(v: any) {
|
|
>accessor : Symbol(S.accessor, Decl(classStaticBlock22.ts, 57, 32), Decl(classStaticBlock22.ts, 61, 7))
|
|
>v : Symbol(v, Decl(classStaticBlock22.ts, 62, 26))
|
|
|
|
await;
|
|
>await : Symbol(await, Decl(classStaticBlock22.ts, 0, 3))
|
|
}
|
|
static propLambda = () => { await; }
|
|
>propLambda : Symbol(S.propLambda, Decl(classStaticBlock22.ts, 64, 7))
|
|
>await : Symbol(await, Decl(classStaticBlock22.ts, 0, 3))
|
|
|
|
static propFunc = function () { await; }
|
|
>propFunc : Symbol(S.propFunc, Decl(classStaticBlock22.ts, 65, 42))
|
|
>await : Symbol(await, Decl(classStaticBlock22.ts, 0, 3))
|
|
}
|
|
}
|
|
}
|