Skip to content

Commit

Permalink
Added additional test
Browse files Browse the repository at this point in the history
  • Loading branch information
rbuckton committed Aug 25, 2017
1 parent 01b7df6 commit 0851f69
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 0 deletions.
21 changes: 21 additions & 0 deletions tests/baselines/reference/asyncArrowInClassES5.js
@@ -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;
}());
12 changes: 12 additions & 0 deletions tests/baselines/reference/asyncArrowInClassES5.symbols
@@ -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))
}

13 changes: 13 additions & 0 deletions tests/baselines/reference/asyncArrowInClassES5.types
@@ -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
}

9 changes: 9 additions & 0 deletions tests/cases/compiler/asyncArrowInClassES5.ts
@@ -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) => { };
}

0 comments on commit 0851f69

Please sign in to comment.