-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
122 additions
and
0 deletions.
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
tests/baselines/reference/invalidThisEmitInContextualObjectLiteral.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
//// [invalidThisEmitInContextualObjectLiteral.ts] | ||
interface IDef { | ||
p1: (e:string) => void; | ||
p2: () => (n: number) => any; | ||
} | ||
|
||
class TestController { | ||
public m(def: IDef) { } | ||
public p = this.m({ | ||
p1: e => { }, | ||
p2: () => { return vvvvvvvvv => this; }, | ||
}); | ||
} | ||
|
||
|
||
//// [invalidThisEmitInContextualObjectLiteral.js] | ||
var TestController = (function () { | ||
function TestController() { | ||
var _this = this; | ||
this.p = this.m({ | ||
p1: function (e) { }, | ||
p2: function () { return function (vvvvvvvvv) { return _this; }; } | ||
}); | ||
} | ||
TestController.prototype.m = function (def) { }; | ||
return TestController; | ||
}()); |
39 changes: 39 additions & 0 deletions
39
tests/baselines/reference/invalidThisEmitInContextualObjectLiteral.symbols
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
=== tests/cases/compiler/invalidThisEmitInContextualObjectLiteral.ts === | ||
interface IDef { | ||
>IDef : Symbol(IDef, Decl(invalidThisEmitInContextualObjectLiteral.ts, 0, 0)) | ||
|
||
p1: (e:string) => void; | ||
>p1 : Symbol(p1, Decl(invalidThisEmitInContextualObjectLiteral.ts, 0, 16)) | ||
>e : Symbol(e, Decl(invalidThisEmitInContextualObjectLiteral.ts, 1, 6)) | ||
|
||
p2: () => (n: number) => any; | ||
>p2 : Symbol(p2, Decl(invalidThisEmitInContextualObjectLiteral.ts, 1, 24)) | ||
>n : Symbol(n, Decl(invalidThisEmitInContextualObjectLiteral.ts, 2, 12)) | ||
} | ||
|
||
class TestController { | ||
>TestController : Symbol(TestController, Decl(invalidThisEmitInContextualObjectLiteral.ts, 3, 1)) | ||
|
||
public m(def: IDef) { } | ||
>m : Symbol(m, Decl(invalidThisEmitInContextualObjectLiteral.ts, 5, 22)) | ||
>def : Symbol(def, Decl(invalidThisEmitInContextualObjectLiteral.ts, 6, 10)) | ||
>IDef : Symbol(IDef, Decl(invalidThisEmitInContextualObjectLiteral.ts, 0, 0)) | ||
|
||
public p = this.m({ | ||
>p : Symbol(p, Decl(invalidThisEmitInContextualObjectLiteral.ts, 6, 24)) | ||
>this.m : Symbol(m, Decl(invalidThisEmitInContextualObjectLiteral.ts, 5, 22)) | ||
>this : Symbol(TestController, Decl(invalidThisEmitInContextualObjectLiteral.ts, 3, 1)) | ||
>m : Symbol(m, Decl(invalidThisEmitInContextualObjectLiteral.ts, 5, 22)) | ||
|
||
p1: e => { }, | ||
>p1 : Symbol(p1, Decl(invalidThisEmitInContextualObjectLiteral.ts, 7, 20)) | ||
>e : Symbol(e, Decl(invalidThisEmitInContextualObjectLiteral.ts, 8, 5)) | ||
|
||
p2: () => { return vvvvvvvvv => this; }, | ||
>p2 : Symbol(p2, Decl(invalidThisEmitInContextualObjectLiteral.ts, 8, 15)) | ||
>vvvvvvvvv : Symbol(vvvvvvvvv, Decl(invalidThisEmitInContextualObjectLiteral.ts, 9, 20)) | ||
>this : Symbol(TestController, Decl(invalidThisEmitInContextualObjectLiteral.ts, 3, 1)) | ||
|
||
}); | ||
} | ||
|
44 changes: 44 additions & 0 deletions
44
tests/baselines/reference/invalidThisEmitInContextualObjectLiteral.types
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
=== tests/cases/compiler/invalidThisEmitInContextualObjectLiteral.ts === | ||
interface IDef { | ||
>IDef : IDef | ||
|
||
p1: (e:string) => void; | ||
>p1 : (e: string) => void | ||
>e : string | ||
|
||
p2: () => (n: number) => any; | ||
>p2 : () => (n: number) => any | ||
>n : number | ||
} | ||
|
||
class TestController { | ||
>TestController : TestController | ||
|
||
public m(def: IDef) { } | ||
>m : (def: IDef) => void | ||
>def : IDef | ||
>IDef : IDef | ||
|
||
public p = this.m({ | ||
>p : void | ||
>this.m({ p1: e => { }, p2: () => { return vvvvvvvvv => this; }, }) : void | ||
>this.m : (def: IDef) => void | ||
>this : this | ||
>m : (def: IDef) => void | ||
>{ p1: e => { }, p2: () => { return vvvvvvvvv => this; }, } : { p1: (e: string) => void; p2: () => {}; } | ||
|
||
p1: e => { }, | ||
>p1 : (e: string) => void | ||
>e => { } : (e: string) => void | ||
>e : string | ||
|
||
p2: () => { return vvvvvvvvv => this; }, | ||
>p2 : () => {} | ||
>() => { return vvvvvvvvv => this; } : () => {} | ||
>vvvvvvvvv => this : (vvvvvvvvv: number) => this | ||
>vvvvvvvvv : number | ||
>this : this | ||
|
||
}); | ||
} | ||
|
12 changes: 12 additions & 0 deletions
12
tests/cases/compiler/invalidThisEmitInContextualObjectLiteral.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
interface IDef { | ||
p1: (e:string) => void; | ||
p2: () => (n: number) => any; | ||
} | ||
|
||
class TestController { | ||
public m(def: IDef) { } | ||
public p = this.m({ | ||
p1: e => { }, | ||
p2: () => { return vvvvvvvvv => this; }, | ||
}); | ||
} |