Skip to content

Commit 0851f69

Browse files
committed
Added additional test
1 parent 01b7df6 commit 0851f69

File tree

4 files changed

+55
-0
lines changed

4 files changed

+55
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
//// [asyncArrowInClassES5.ts]
2+
// https://github.com/Microsoft/TypeScript/issues/16924
3+
// Should capture `this`
4+
5+
class Test {
6+
static member = async (x: string) => { };
7+
}
8+
9+
10+
//// [asyncArrowInClassES5.js]
11+
// https://github.com/Microsoft/TypeScript/issues/16924
12+
// Should capture `this`
13+
var _this = this;
14+
var Test = /** @class */ (function () {
15+
function Test() {
16+
}
17+
Test.member = function (x) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
18+
return [2 /*return*/];
19+
}); }); };
20+
return Test;
21+
}());
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
=== tests/cases/compiler/asyncArrowInClassES5.ts ===
2+
// https://github.com/Microsoft/TypeScript/issues/16924
3+
// Should capture `this`
4+
5+
class Test {
6+
>Test : Symbol(Test, Decl(asyncArrowInClassES5.ts, 0, 0))
7+
8+
static member = async (x: string) => { };
9+
>member : Symbol(Test.member, Decl(asyncArrowInClassES5.ts, 3, 12))
10+
>x : Symbol(x, Decl(asyncArrowInClassES5.ts, 4, 27))
11+
}
12+
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
=== tests/cases/compiler/asyncArrowInClassES5.ts ===
2+
// https://github.com/Microsoft/TypeScript/issues/16924
3+
// Should capture `this`
4+
5+
class Test {
6+
>Test : Test
7+
8+
static member = async (x: string) => { };
9+
>member : (x: string) => Promise<void>
10+
>async (x: string) => { } : (x: string) => Promise<void>
11+
>x : string
12+
}
13+
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// @noEmitHelpers: true
2+
// @lib: es2015
3+
// @target: es5
4+
// https://github.com/Microsoft/TypeScript/issues/16924
5+
// Should capture `this`
6+
7+
class Test {
8+
static member = async (x: string) => { };
9+
}

0 commit comments

Comments
 (0)