Fix name generation scoping (#58418)

This commit is contained in:
Ron Buckton authored and GitHub committed 2024-05-06 11:59:37 -04:00
1 parent e154d47851
commit 70d8ec2f26
11 files changed
+180 -155

No files matched your search

@@ -17,4 +17,29 @@ describe("unittests:: evaluation:: asyncArrowEvaluation", () => {
await result.main();
assert.instanceOf(result.output[0].a(), result.A);
});
// https://github.com/microsoft/TypeScript/issues/57897
it("Class alias (es5)", async () => {
const result = evaluator.evaluateTypeScript(`
class X {
public static a = async (someVar: boolean = true) => {
return await X.b();
};
public static b = async () => {
return "GOOD";
};
}
export async function main() {
try {
return await X.a();
}
catch (e) {
return "BAD";
}
}`);
const output = await result.main();
assert.equal(output, "GOOD");
});
});