mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Added additional test
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
//// [asyncArrowInClassES5.ts]
|
||||
// https://github.com/Microsoft/TypeScript/issues/16924
|
||||
// Should capture `this`
|
||||
|
||||
class Test {
|
||||
static member = async (x: string) => { };
|
||||
}
|
||||
|
||||
|
||||
//// [asyncArrowInClassES5.js]
|
||||
// https://github.com/Microsoft/TypeScript/issues/16924
|
||||
// Should capture `this`
|
||||
var _this = this;
|
||||
var Test = /** @class */ (function () {
|
||||
function Test() {
|
||||
}
|
||||
Test.member = function (x) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
|
||||
return [2 /*return*/];
|
||||
}); }); };
|
||||
return Test;
|
||||
}());
|
||||
@@ -0,0 +1,12 @@
|
||||
=== tests/cases/compiler/asyncArrowInClassES5.ts ===
|
||||
// https://github.com/Microsoft/TypeScript/issues/16924
|
||||
// Should capture `this`
|
||||
|
||||
class Test {
|
||||
>Test : Symbol(Test, Decl(asyncArrowInClassES5.ts, 0, 0))
|
||||
|
||||
static member = async (x: string) => { };
|
||||
>member : Symbol(Test.member, Decl(asyncArrowInClassES5.ts, 3, 12))
|
||||
>x : Symbol(x, Decl(asyncArrowInClassES5.ts, 4, 27))
|
||||
}
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
=== tests/cases/compiler/asyncArrowInClassES5.ts ===
|
||||
// https://github.com/Microsoft/TypeScript/issues/16924
|
||||
// Should capture `this`
|
||||
|
||||
class Test {
|
||||
>Test : Test
|
||||
|
||||
static member = async (x: string) => { };
|
||||
>member : (x: string) => Promise<void>
|
||||
>async (x: string) => { } : (x: string) => Promise<void>
|
||||
>x : string
|
||||
}
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
// @noEmitHelpers: true
|
||||
// @lib: es2015
|
||||
// @target: es5
|
||||
// https://github.com/Microsoft/TypeScript/issues/16924
|
||||
// Should capture `this`
|
||||
|
||||
class Test {
|
||||
static member = async (x: string) => { };
|
||||
}
|
||||
Reference in New Issue
Block a user