Added additional test

This commit is contained in:
Ron Buckton
2017-08-24 17:02:52 -07:00
parent 01b7df6855
commit 0851f6909e
4 changed files with 55 additions and 0 deletions
@@ -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) => { };
}