From f77cd8e54bcdeb6528e091740ddaaa20063f9544 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Tue, 28 Feb 2017 16:11:05 -0800 Subject: [PATCH] Accept new baselines --- tests/baselines/reference/castTest.symbols | 6 -- tests/baselines/reference/castTest.types | 16 ++-- .../commentsOnObjectLiteral3.symbols | 7 -- .../reference/commentsOnObjectLiteral3.types | 26 ++--- ...declFileObjectLiteralWithAccessors.symbols | 3 - .../declFileObjectLiteralWithAccessors.types | 6 +- ...eclFileObjectLiteralWithOnlySetter.symbols | 3 - .../declFileObjectLiteralWithOnlySetter.types | 6 +- ...iationAssignmentWithIndexingOnLHS3.symbols | 7 -- ...ntiationAssignmentWithIndexingOnLHS3.types | 12 +-- .../reference/fatarrowfunctions.symbols | 5 - .../reference/fatarrowfunctions.types | 12 +-- .../fatarrowfunctionsInFunctions.symbols | 5 - .../fatarrowfunctionsInFunctions.types | 16 ++-- .../looseThisTypeInFunctions.errors.txt | 11 ++- .../reference/looseThisTypeInFunctions.js | 1 + .../baselines/reference/objectSpread.symbols | 3 - tests/baselines/reference/objectSpread.types | 12 +-- tests/baselines/reference/selfInLambdas.js | 1 + .../baselines/reference/selfInLambdas.symbols | 71 +++++++------- tests/baselines/reference/selfInLambdas.types | 1 + .../reference/thisBinding2.errors.txt | 28 ++++++ tests/baselines/reference/thisBinding2.js | 1 + .../reference/thisInObjectLiterals.errors.txt | 25 ----- .../reference/thisInObjectLiterals.symbols | 45 +++++++++ .../reference/thisInObjectLiterals.types | 50 ++++++++++ .../thisInPropertyBoundDeclarations.symbols | 2 - .../thisInPropertyBoundDeclarations.types | 12 +-- .../reference/thisTypeInFunctions2.errors.txt | 60 ++++++++++++ .../reference/thisTypeInFunctions2.js | 1 + .../reference/thisTypeInObjectLiterals.js | 1 + .../thisTypeInObjectLiterals.symbols | 95 ++++++++++--------- .../reference/thisTypeInObjectLiterals.types | 1 + .../throwInEnclosingStatements.symbols | 1 - .../throwInEnclosingStatements.types | 2 +- .../reference/underscoreTest1.symbols | 6 -- .../baselines/reference/underscoreTest1.types | 12 +-- 37 files changed, 346 insertions(+), 226 deletions(-) create mode 100644 tests/baselines/reference/thisBinding2.errors.txt delete mode 100644 tests/baselines/reference/thisInObjectLiterals.errors.txt create mode 100644 tests/baselines/reference/thisInObjectLiterals.symbols create mode 100644 tests/baselines/reference/thisInObjectLiterals.types create mode 100644 tests/baselines/reference/thisTypeInFunctions2.errors.txt diff --git a/tests/baselines/reference/castTest.symbols b/tests/baselines/reference/castTest.symbols index 0baee00ec47..944cc8238e6 100644 --- a/tests/baselines/reference/castTest.symbols +++ b/tests/baselines/reference/castTest.symbols @@ -71,13 +71,7 @@ var p_cast = ({ return new Point(this.x + dx, this.y + dy); >Point : Symbol(Point, Decl(castTest.ts, 11, 37)) ->this.x : Symbol(Point.x, Decl(castTest.ts, 14, 1)) ->this : Symbol(Point, Decl(castTest.ts, 11, 37)) ->x : Symbol(Point.x, Decl(castTest.ts, 14, 1)) >dx : Symbol(dx, Decl(castTest.ts, 25, 18)) ->this.y : Symbol(Point.y, Decl(castTest.ts, 15, 14)) ->this : Symbol(Point, Decl(castTest.ts, 11, 37)) ->y : Symbol(Point.y, Decl(castTest.ts, 15, 14)) >dy : Symbol(dy, Decl(castTest.ts, 25, 21)) }, diff --git a/tests/baselines/reference/castTest.types b/tests/baselines/reference/castTest.types index 08c9853dca6..666b2ccf78e 100644 --- a/tests/baselines/reference/castTest.types +++ b/tests/baselines/reference/castTest.types @@ -91,15 +91,15 @@ var p_cast = ({ return new Point(this.x + dx, this.y + dy); >new Point(this.x + dx, this.y + dy) : Point >Point : typeof Point ->this.x + dx : number ->this.x : number ->this : Point ->x : number +>this.x + dx : any +>this.x : any +>this : any +>x : any >dx : number ->this.y + dy : number ->this.y : number ->this : Point ->y : number +>this.y + dy : any +>this.y : any +>this : any +>y : any >dy : number }, diff --git a/tests/baselines/reference/commentsOnObjectLiteral3.symbols b/tests/baselines/reference/commentsOnObjectLiteral3.symbols index 34b4c706b42..3d58fe2d6d7 100644 --- a/tests/baselines/reference/commentsOnObjectLiteral3.symbols +++ b/tests/baselines/reference/commentsOnObjectLiteral3.symbols @@ -21,10 +21,6 @@ var v = { >a : Symbol(a, Decl(commentsOnObjectLiteral3.ts, 8, 13), Decl(commentsOnObjectLiteral3.ts, 12, 18)) return this.prop; ->this.prop : Symbol(prop, Decl(commentsOnObjectLiteral3.ts, 1, 9)) ->this : Symbol(v, Decl(commentsOnObjectLiteral3.ts, 1, 7)) ->prop : Symbol(prop, Decl(commentsOnObjectLiteral3.ts, 1, 9)) - } /*trailing 1*/, //setter set a(value) { @@ -32,9 +28,6 @@ var v = { >value : Symbol(value, Decl(commentsOnObjectLiteral3.ts, 14, 7)) this.prop = value; ->this.prop : Symbol(prop, Decl(commentsOnObjectLiteral3.ts, 1, 9)) ->this : Symbol(v, Decl(commentsOnObjectLiteral3.ts, 1, 7)) ->prop : Symbol(prop, Decl(commentsOnObjectLiteral3.ts, 1, 9)) >value : Symbol(value, Decl(commentsOnObjectLiteral3.ts, 14, 7)) } // trailing 2 diff --git a/tests/baselines/reference/commentsOnObjectLiteral3.types b/tests/baselines/reference/commentsOnObjectLiteral3.types index b869e961401..4053e7e3f89 100644 --- a/tests/baselines/reference/commentsOnObjectLiteral3.types +++ b/tests/baselines/reference/commentsOnObjectLiteral3.types @@ -1,8 +1,8 @@ === tests/cases/compiler/commentsOnObjectLiteral3.ts === var v = { ->v : { prop: number; func: () => void; func1(): void; a: number; } ->{ //property prop: 1 /* multiple trailing comments */ /*trailing comments*/, //property func: function () { }, //PropertyName + CallSignature func1() { }, //getter get a() { return this.prop; } /*trailing 1*/, //setter set a(value) { this.prop = value; } // trailing 2} : { prop: number; func: () => void; func1(): void; a: number; } +>v : { prop: number; func: () => void; func1(): void; a: any; } +>{ //property prop: 1 /* multiple trailing comments */ /*trailing comments*/, //property func: function () { }, //PropertyName + CallSignature func1() { }, //getter get a() { return this.prop; } /*trailing 1*/, //setter set a(value) { this.prop = value; } // trailing 2} : { prop: number; func: () => void; func1(): void; a: any; } //property prop: 1 /* multiple trailing comments */ /*trailing comments*/, @@ -21,25 +21,25 @@ var v = { //getter get a() { ->a : number +>a : any return this.prop; ->this.prop : number ->this : { prop: number; func: () => void; func1(): void; a: number; } ->prop : number +>this.prop : any +>this : any +>prop : any } /*trailing 1*/, //setter set a(value) { ->a : number ->value : number +>a : any +>value : any this.prop = value; ->this.prop = value : number ->this.prop : number ->this : { prop: number; func: () => void; func1(): void; a: number; } ->prop : number ->value : number +>this.prop = value : any +>this.prop : any +>this : any +>prop : any +>value : any } // trailing 2 }; diff --git a/tests/baselines/reference/declFileObjectLiteralWithAccessors.symbols b/tests/baselines/reference/declFileObjectLiteralWithAccessors.symbols index df94b262c74..862b0b3781e 100644 --- a/tests/baselines/reference/declFileObjectLiteralWithAccessors.symbols +++ b/tests/baselines/reference/declFileObjectLiteralWithAccessors.symbols @@ -15,9 +15,6 @@ function /*1*/makePoint(x: number) { set x(a: number) { this.b = a; } >x : Symbol(x, Decl(declFileObjectLiteralWithAccessors.ts, 3, 14), Decl(declFileObjectLiteralWithAccessors.ts, 4, 30)) >a : Symbol(a, Decl(declFileObjectLiteralWithAccessors.ts, 5, 14)) ->this.b : Symbol(b, Decl(declFileObjectLiteralWithAccessors.ts, 2, 12)) ->this : Symbol(__object, Decl(declFileObjectLiteralWithAccessors.ts, 2, 10)) ->b : Symbol(b, Decl(declFileObjectLiteralWithAccessors.ts, 2, 12)) >a : Symbol(a, Decl(declFileObjectLiteralWithAccessors.ts, 5, 14)) }; diff --git a/tests/baselines/reference/declFileObjectLiteralWithAccessors.types b/tests/baselines/reference/declFileObjectLiteralWithAccessors.types index 1c36f321118..389b88de565 100644 --- a/tests/baselines/reference/declFileObjectLiteralWithAccessors.types +++ b/tests/baselines/reference/declFileObjectLiteralWithAccessors.types @@ -19,9 +19,9 @@ function /*1*/makePoint(x: number) { >x : number >a : number >this.b = a : number ->this.b : number ->this : { b: number; x: number; } ->b : number +>this.b : any +>this : any +>b : any >a : number }; diff --git a/tests/baselines/reference/declFileObjectLiteralWithOnlySetter.symbols b/tests/baselines/reference/declFileObjectLiteralWithOnlySetter.symbols index 9dd2461b871..f7474466140 100644 --- a/tests/baselines/reference/declFileObjectLiteralWithOnlySetter.symbols +++ b/tests/baselines/reference/declFileObjectLiteralWithOnlySetter.symbols @@ -11,9 +11,6 @@ function /*1*/makePoint(x: number) { set x(a: number) { this.b = a; } >x : Symbol(x, Decl(declFileObjectLiteralWithOnlySetter.ts, 3, 14)) >a : Symbol(a, Decl(declFileObjectLiteralWithOnlySetter.ts, 4, 14)) ->this.b : Symbol(b, Decl(declFileObjectLiteralWithOnlySetter.ts, 2, 12)) ->this : Symbol(__object, Decl(declFileObjectLiteralWithOnlySetter.ts, 2, 10)) ->b : Symbol(b, Decl(declFileObjectLiteralWithOnlySetter.ts, 2, 12)) >a : Symbol(a, Decl(declFileObjectLiteralWithOnlySetter.ts, 4, 14)) }; diff --git a/tests/baselines/reference/declFileObjectLiteralWithOnlySetter.types b/tests/baselines/reference/declFileObjectLiteralWithOnlySetter.types index bf62561f57d..2f15818e0f2 100644 --- a/tests/baselines/reference/declFileObjectLiteralWithOnlySetter.types +++ b/tests/baselines/reference/declFileObjectLiteralWithOnlySetter.types @@ -15,9 +15,9 @@ function /*1*/makePoint(x: number) { >x : number >a : number >this.b = a : number ->this.b : number ->this : { b: number; x: number; } ->b : number +>this.b : any +>this : any +>b : any >a : number }; diff --git a/tests/baselines/reference/emitCompoundExponentiationAssignmentWithIndexingOnLHS3.symbols b/tests/baselines/reference/emitCompoundExponentiationAssignmentWithIndexingOnLHS3.symbols index 785a5654681..dbd5aa150dc 100644 --- a/tests/baselines/reference/emitCompoundExponentiationAssignmentWithIndexingOnLHS3.symbols +++ b/tests/baselines/reference/emitCompoundExponentiationAssignmentWithIndexingOnLHS3.symbols @@ -8,18 +8,11 @@ var object = { get 0() { return this._0; ->this._0 : Symbol(_0, Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS3.ts, 1, 14)) ->this : Symbol(object, Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS3.ts, 1, 12)) ->_0 : Symbol(_0, Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS3.ts, 1, 14)) - }, set 0(x: number) { >x : Symbol(x, Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS3.ts, 6, 10)) this._0 = x; ->this._0 : Symbol(_0, Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS3.ts, 1, 14)) ->this : Symbol(object, Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS3.ts, 1, 12)) ->_0 : Symbol(_0, Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS3.ts, 1, 14)) >x : Symbol(x, Decl(emitCompoundExponentiationAssignmentWithIndexingOnLHS3.ts, 6, 10)) }, diff --git a/tests/baselines/reference/emitCompoundExponentiationAssignmentWithIndexingOnLHS3.types b/tests/baselines/reference/emitCompoundExponentiationAssignmentWithIndexingOnLHS3.types index 77026be2795..32e5b33e411 100644 --- a/tests/baselines/reference/emitCompoundExponentiationAssignmentWithIndexingOnLHS3.types +++ b/tests/baselines/reference/emitCompoundExponentiationAssignmentWithIndexingOnLHS3.types @@ -10,9 +10,9 @@ var object = { get 0() { return this._0; ->this._0 : number ->this : { _0: number; 0: number; } ->_0 : number +>this._0 : any +>this : any +>_0 : any }, set 0(x: number) { @@ -20,9 +20,9 @@ var object = { this._0 = x; >this._0 = x : number ->this._0 : number ->this : { _0: number; 0: number; } ->_0 : number +>this._0 : any +>this : any +>_0 : any >x : number }, diff --git a/tests/baselines/reference/fatarrowfunctions.symbols b/tests/baselines/reference/fatarrowfunctions.symbols index 25213a9bbf8..6ed865b0914 100644 --- a/tests/baselines/reference/fatarrowfunctions.symbols +++ b/tests/baselines/reference/fatarrowfunctions.symbols @@ -163,11 +163,6 @@ var messenger = { setTimeout(() => { this.message.toString(); }, 3000); >setTimeout : Symbol(setTimeout, Decl(fatarrowfunctions.ts, 34, 1)) ->this.message.toString : Symbol(String.toString, Decl(lib.d.ts, --, --)) ->this.message : Symbol(message, Decl(fatarrowfunctions.ts, 38, 17)) ->this : Symbol(messenger, Decl(fatarrowfunctions.ts, 38, 15)) ->message : Symbol(message, Decl(fatarrowfunctions.ts, 38, 17)) ->toString : Symbol(String.toString, Decl(lib.d.ts, --, --)) } }; diff --git a/tests/baselines/reference/fatarrowfunctions.types b/tests/baselines/reference/fatarrowfunctions.types index 1114ae365cb..304c341c916 100644 --- a/tests/baselines/reference/fatarrowfunctions.types +++ b/tests/baselines/reference/fatarrowfunctions.types @@ -234,12 +234,12 @@ var messenger = { >setTimeout(() => { this.message.toString(); }, 3000) : number >setTimeout : (expression: any, msec?: number, language?: any) => number >() => { this.message.toString(); } : () => void ->this.message.toString() : string ->this.message.toString : () => string ->this.message : string ->this : { message: string; start: () => void; } ->message : string ->toString : () => string +>this.message.toString() : any +>this.message.toString : any +>this.message : any +>this : any +>message : any +>toString : any >3000 : 3000 } }; diff --git a/tests/baselines/reference/fatarrowfunctionsInFunctions.symbols b/tests/baselines/reference/fatarrowfunctionsInFunctions.symbols index 977dd39460d..0a86affc215 100644 --- a/tests/baselines/reference/fatarrowfunctionsInFunctions.symbols +++ b/tests/baselines/reference/fatarrowfunctionsInFunctions.symbols @@ -16,17 +16,12 @@ var messenger = { var _self = this; >_self : Symbol(_self, Decl(fatarrowfunctionsInFunctions.ts, 5, 11)) ->this : Symbol(messenger, Decl(fatarrowfunctionsInFunctions.ts, 2, 15)) setTimeout(function() { >setTimeout : Symbol(setTimeout, Decl(fatarrowfunctionsInFunctions.ts, 0, 0)) _self.message.toString(); ->_self.message.toString : Symbol(String.toString, Decl(lib.d.ts, --, --)) ->_self.message : Symbol(message, Decl(fatarrowfunctionsInFunctions.ts, 2, 17)) >_self : Symbol(_self, Decl(fatarrowfunctionsInFunctions.ts, 5, 11)) ->message : Symbol(message, Decl(fatarrowfunctionsInFunctions.ts, 2, 17)) ->toString : Symbol(String.toString, Decl(lib.d.ts, --, --)) }, 3000); } diff --git a/tests/baselines/reference/fatarrowfunctionsInFunctions.types b/tests/baselines/reference/fatarrowfunctionsInFunctions.types index 88807f2a37b..8b9bd7ccd7a 100644 --- a/tests/baselines/reference/fatarrowfunctionsInFunctions.types +++ b/tests/baselines/reference/fatarrowfunctionsInFunctions.types @@ -18,8 +18,8 @@ var messenger = { >function() { var _self = this; setTimeout(function() { _self.message.toString(); }, 3000); } : () => void var _self = this; ->_self : { message: string; start: () => void; } ->this : { message: string; start: () => void; } +>_self : any +>this : any setTimeout(function() { >setTimeout(function() { _self.message.toString(); }, 3000) : number @@ -27,12 +27,12 @@ var messenger = { >function() { _self.message.toString(); } : () => void _self.message.toString(); ->_self.message.toString() : string ->_self.message.toString : () => string ->_self.message : string ->_self : { message: string; start: () => void; } ->message : string ->toString : () => string +>_self.message.toString() : any +>_self.message.toString : any +>_self.message : any +>_self : any +>message : any +>toString : any }, 3000); >3000 : 3000 diff --git a/tests/baselines/reference/looseThisTypeInFunctions.errors.txt b/tests/baselines/reference/looseThisTypeInFunctions.errors.txt index 7e12a714406..cf4dcbd7dd5 100644 --- a/tests/baselines/reference/looseThisTypeInFunctions.errors.txt +++ b/tests/baselines/reference/looseThisTypeInFunctions.errors.txt @@ -1,13 +1,14 @@ -tests/cases/conformance/types/thisType/looseThisTypeInFunctions.ts(21,1): error TS2322: Type '(this: C, m: number) => number' is not assignable to type '(this: void, m: number) => number'. +tests/cases/conformance/types/thisType/looseThisTypeInFunctions.ts(22,1): error TS2322: Type '(this: C, m: number) => number' is not assignable to type '(this: void, m: number) => number'. The 'this' types of each signature are incompatible. Type 'void' is not assignable to type 'C'. -tests/cases/conformance/types/thisType/looseThisTypeInFunctions.ts(25,27): error TS2339: Property 'length' does not exist on type 'number'. -tests/cases/conformance/types/thisType/looseThisTypeInFunctions.ts(33,28): error TS2339: Property 'length' does not exist on type 'number'. -tests/cases/conformance/types/thisType/looseThisTypeInFunctions.ts(37,9): error TS2684: The 'this' context of type 'void' is not assignable to method's 'this' of type 'I'. -tests/cases/conformance/types/thisType/looseThisTypeInFunctions.ts(46,20): error TS2339: Property 'length' does not exist on type 'number'. +tests/cases/conformance/types/thisType/looseThisTypeInFunctions.ts(26,27): error TS2339: Property 'length' does not exist on type 'number'. +tests/cases/conformance/types/thisType/looseThisTypeInFunctions.ts(34,28): error TS2339: Property 'length' does not exist on type 'number'. +tests/cases/conformance/types/thisType/looseThisTypeInFunctions.ts(38,9): error TS2684: The 'this' context of type 'void' is not assignable to method's 'this' of type 'I'. +tests/cases/conformance/types/thisType/looseThisTypeInFunctions.ts(47,20): error TS2339: Property 'length' does not exist on type 'number'. ==== tests/cases/conformance/types/thisType/looseThisTypeInFunctions.ts (5 errors) ==== + interface I { n: number; explicitThis(this: this, m: number): number; diff --git a/tests/baselines/reference/looseThisTypeInFunctions.js b/tests/baselines/reference/looseThisTypeInFunctions.js index cb1fbcc8b95..3e97691ade2 100644 --- a/tests/baselines/reference/looseThisTypeInFunctions.js +++ b/tests/baselines/reference/looseThisTypeInFunctions.js @@ -1,4 +1,5 @@ //// [looseThisTypeInFunctions.ts] + interface I { n: number; explicitThis(this: this, m: number): number; diff --git a/tests/baselines/reference/objectSpread.symbols b/tests/baselines/reference/objectSpread.symbols index 0538121e90c..1ec2520e166 100644 --- a/tests/baselines/reference/objectSpread.symbols +++ b/tests/baselines/reference/objectSpread.symbols @@ -200,9 +200,6 @@ let cplus: { p: number, plus(): void } = { ...c, plus() { return this.p + 1; } } >plus : Symbol(plus, Decl(objectSpread.ts, 49, 23)) >c : Symbol(c, Decl(objectSpread.ts, 45, 3)) >plus : Symbol(plus, Decl(objectSpread.ts, 49, 48)) ->this.p : Symbol(p, Decl(objectSpread.ts, 49, 12)) ->this : Symbol(cplus, Decl(objectSpread.ts, 49, 10)) ->p : Symbol(p, Decl(objectSpread.ts, 49, 12)) cplus.plus(); >cplus.plus : Symbol(plus, Decl(objectSpread.ts, 49, 23)) diff --git a/tests/baselines/reference/objectSpread.types b/tests/baselines/reference/objectSpread.types index 3a736721425..950dab43465 100644 --- a/tests/baselines/reference/objectSpread.types +++ b/tests/baselines/reference/objectSpread.types @@ -263,13 +263,13 @@ let cplus: { p: number, plus(): void } = { ...c, plus() { return this.p + 1; } } >cplus : { p: number; plus(): void; } >p : number >plus : () => void ->{ ...c, plus() { return this.p + 1; } } : { plus(): number; p: number; } +>{ ...c, plus() { return this.p + 1; } } : { plus(): any; p: number; } >c : C ->plus : () => number ->this.p + 1 : number ->this.p : number ->this : { p: number; plus(): void; } ->p : number +>plus : () => any +>this.p + 1 : any +>this.p : any +>this : any +>p : any >1 : 1 cplus.plus(); diff --git a/tests/baselines/reference/selfInLambdas.js b/tests/baselines/reference/selfInLambdas.js index b143c0c9e4e..f9654606716 100644 --- a/tests/baselines/reference/selfInLambdas.js +++ b/tests/baselines/reference/selfInLambdas.js @@ -1,4 +1,5 @@ //// [selfInLambdas.ts] + interface MouseEvent { x: number; y: number; diff --git a/tests/baselines/reference/selfInLambdas.symbols b/tests/baselines/reference/selfInLambdas.symbols index 0a51113710b..8efadb7c077 100644 --- a/tests/baselines/reference/selfInLambdas.symbols +++ b/tests/baselines/reference/selfInLambdas.symbols @@ -1,51 +1,52 @@ === tests/cases/compiler/selfInLambdas.ts === + interface MouseEvent { >MouseEvent : Symbol(MouseEvent, Decl(selfInLambdas.ts, 0, 0)) x: number; ->x : Symbol(MouseEvent.x, Decl(selfInLambdas.ts, 0, 22)) +>x : Symbol(MouseEvent.x, Decl(selfInLambdas.ts, 1, 22)) y: number; ->y : Symbol(MouseEvent.y, Decl(selfInLambdas.ts, 1, 14)) +>y : Symbol(MouseEvent.y, Decl(selfInLambdas.ts, 2, 14)) } declare var window: Window; ->window : Symbol(window, Decl(selfInLambdas.ts, 5, 11)) ->Window : Symbol(Window, Decl(selfInLambdas.ts, 5, 27)) +>window : Symbol(window, Decl(selfInLambdas.ts, 6, 11)) +>Window : Symbol(Window, Decl(selfInLambdas.ts, 6, 27)) interface Window { ->Window : Symbol(Window, Decl(selfInLambdas.ts, 5, 27)) +>Window : Symbol(Window, Decl(selfInLambdas.ts, 6, 27)) onmousemove: (ev: MouseEvent) => any; ->onmousemove : Symbol(Window.onmousemove, Decl(selfInLambdas.ts, 6, 18)) ->ev : Symbol(ev, Decl(selfInLambdas.ts, 7, 18)) +>onmousemove : Symbol(Window.onmousemove, Decl(selfInLambdas.ts, 7, 18)) +>ev : Symbol(ev, Decl(selfInLambdas.ts, 8, 18)) >MouseEvent : Symbol(MouseEvent, Decl(selfInLambdas.ts, 0, 0)) } var o = { ->o : Symbol(o, Decl(selfInLambdas.ts, 10, 3)) +>o : Symbol(o, Decl(selfInLambdas.ts, 11, 3)) counter: 0, ->counter : Symbol(counter, Decl(selfInLambdas.ts, 10, 9)) +>counter : Symbol(counter, Decl(selfInLambdas.ts, 11, 9)) start: function() { ->start : Symbol(start, Decl(selfInLambdas.ts, 12, 15)) +>start : Symbol(start, Decl(selfInLambdas.ts, 13, 15)) window.onmousemove = () => { ->window.onmousemove : Symbol(Window.onmousemove, Decl(selfInLambdas.ts, 6, 18)) ->window : Symbol(window, Decl(selfInLambdas.ts, 5, 11)) ->onmousemove : Symbol(Window.onmousemove, Decl(selfInLambdas.ts, 6, 18)) +>window.onmousemove : Symbol(Window.onmousemove, Decl(selfInLambdas.ts, 7, 18)) +>window : Symbol(window, Decl(selfInLambdas.ts, 6, 11)) +>onmousemove : Symbol(Window.onmousemove, Decl(selfInLambdas.ts, 7, 18)) this.counter++ ->this.counter : Symbol(counter, Decl(selfInLambdas.ts, 10, 9)) ->this : Symbol(o, Decl(selfInLambdas.ts, 10, 7)) ->counter : Symbol(counter, Decl(selfInLambdas.ts, 10, 9)) +>this.counter : Symbol(counter, Decl(selfInLambdas.ts, 11, 9)) +>this : Symbol(o, Decl(selfInLambdas.ts, 11, 7)) +>counter : Symbol(counter, Decl(selfInLambdas.ts, 11, 9)) var f = () => this.counter; ->f : Symbol(f, Decl(selfInLambdas.ts, 18, 15)) ->this.counter : Symbol(counter, Decl(selfInLambdas.ts, 10, 9)) ->this : Symbol(o, Decl(selfInLambdas.ts, 10, 7)) ->counter : Symbol(counter, Decl(selfInLambdas.ts, 10, 9)) +>f : Symbol(f, Decl(selfInLambdas.ts, 19, 15)) +>this.counter : Symbol(counter, Decl(selfInLambdas.ts, 11, 9)) +>this : Symbol(o, Decl(selfInLambdas.ts, 11, 7)) +>counter : Symbol(counter, Decl(selfInLambdas.ts, 11, 9)) } @@ -56,39 +57,39 @@ var o = { class X { ->X : Symbol(X, Decl(selfInLambdas.ts, 24, 1)) +>X : Symbol(X, Decl(selfInLambdas.ts, 25, 1)) private value = "value"; ->value : Symbol(X.value, Decl(selfInLambdas.ts, 28, 9)) +>value : Symbol(X.value, Decl(selfInLambdas.ts, 29, 9)) public foo() { ->foo : Symbol(X.foo, Decl(selfInLambdas.ts, 29, 25)) +>foo : Symbol(X.foo, Decl(selfInLambdas.ts, 30, 25)) var outer= () => { ->outer : Symbol(outer, Decl(selfInLambdas.ts, 32, 5)) +>outer : Symbol(outer, Decl(selfInLambdas.ts, 33, 5)) var x = this.value; ->x : Symbol(x, Decl(selfInLambdas.ts, 33, 15)) ->this.value : Symbol(X.value, Decl(selfInLambdas.ts, 28, 9)) ->this : Symbol(X, Decl(selfInLambdas.ts, 24, 1)) ->value : Symbol(X.value, Decl(selfInLambdas.ts, 28, 9)) +>x : Symbol(x, Decl(selfInLambdas.ts, 34, 15)) +>this.value : Symbol(X.value, Decl(selfInLambdas.ts, 29, 9)) +>this : Symbol(X, Decl(selfInLambdas.ts, 25, 1)) +>value : Symbol(X.value, Decl(selfInLambdas.ts, 29, 9)) var inner = () => { ->inner : Symbol(inner, Decl(selfInLambdas.ts, 34, 15)) +>inner : Symbol(inner, Decl(selfInLambdas.ts, 35, 15)) var y = this.value; ->y : Symbol(y, Decl(selfInLambdas.ts, 35, 19)) ->this.value : Symbol(X.value, Decl(selfInLambdas.ts, 28, 9)) ->this : Symbol(X, Decl(selfInLambdas.ts, 24, 1)) ->value : Symbol(X.value, Decl(selfInLambdas.ts, 28, 9)) +>y : Symbol(y, Decl(selfInLambdas.ts, 36, 19)) +>this.value : Symbol(X.value, Decl(selfInLambdas.ts, 29, 9)) +>this : Symbol(X, Decl(selfInLambdas.ts, 25, 1)) +>value : Symbol(X.value, Decl(selfInLambdas.ts, 29, 9)) } inner(); ->inner : Symbol(inner, Decl(selfInLambdas.ts, 34, 15)) +>inner : Symbol(inner, Decl(selfInLambdas.ts, 35, 15)) }; outer(); ->outer : Symbol(outer, Decl(selfInLambdas.ts, 32, 5)) +>outer : Symbol(outer, Decl(selfInLambdas.ts, 33, 5)) } } diff --git a/tests/baselines/reference/selfInLambdas.types b/tests/baselines/reference/selfInLambdas.types index a26e1e0bf28..251cfb2d0c3 100644 --- a/tests/baselines/reference/selfInLambdas.types +++ b/tests/baselines/reference/selfInLambdas.types @@ -1,4 +1,5 @@ === tests/cases/compiler/selfInLambdas.ts === + interface MouseEvent { >MouseEvent : MouseEvent diff --git a/tests/baselines/reference/thisBinding2.errors.txt b/tests/baselines/reference/thisBinding2.errors.txt new file mode 100644 index 00000000000..ddfa078a2d2 --- /dev/null +++ b/tests/baselines/reference/thisBinding2.errors.txt @@ -0,0 +1,28 @@ +tests/cases/compiler/thisBinding2.ts(11,11): error TS2683: 'this' implicitly has type 'any' because it does not have a type annotation. + + +==== tests/cases/compiler/thisBinding2.ts (1 errors) ==== + + class C { + x: number; + constructor() { + this.x = (() => { + var x = 1; + return this.x; + })(); + this.x = function() { + var x = 1; + return this.x; + ~~~~ +!!! error TS2683: 'this' implicitly has type 'any' because it does not have a type annotation. + }(); + } + } + declare function setTimeout(expression: any, msec?: number, language?: any): number; + var messenger = { + message: "Hello World", + start: function () { + return setTimeout(() => { var x = this.message; }, 3000); + } + }; + \ No newline at end of file diff --git a/tests/baselines/reference/thisBinding2.js b/tests/baselines/reference/thisBinding2.js index 142cd9db4a5..732cb4fac00 100644 --- a/tests/baselines/reference/thisBinding2.js +++ b/tests/baselines/reference/thisBinding2.js @@ -1,4 +1,5 @@ //// [thisBinding2.ts] + class C { x: number; constructor() { diff --git a/tests/baselines/reference/thisInObjectLiterals.errors.txt b/tests/baselines/reference/thisInObjectLiterals.errors.txt deleted file mode 100644 index 3da8430802d..00000000000 --- a/tests/baselines/reference/thisInObjectLiterals.errors.txt +++ /dev/null @@ -1,25 +0,0 @@ -tests/cases/conformance/expressions/thisKeyword/thisInObjectLiterals.ts(15,21): error TS2339: Property 'spaaace' does not exist on type '{ f(): any; }'. - - -==== tests/cases/conformance/expressions/thisKeyword/thisInObjectLiterals.ts (1 errors) ==== - class MyClass { - t: number; - - fn() { - type ContainingThis = this; - //type of 'this' in an object literal is the containing scope's this - var t = { x: this, y: this.t }; - var t: { x: ContainingThis; y: number }; - } - } - - //type of 'this' in an object literal method is the type of the object literal - var obj = { - f() { - return this.spaaace; - ~~~~~~~ -!!! error TS2339: Property 'spaaace' does not exist on type '{ f(): any; }'. - } - }; - var obj: { f: () => any; }; - \ No newline at end of file diff --git a/tests/baselines/reference/thisInObjectLiterals.symbols b/tests/baselines/reference/thisInObjectLiterals.symbols new file mode 100644 index 00000000000..51f30009b65 --- /dev/null +++ b/tests/baselines/reference/thisInObjectLiterals.symbols @@ -0,0 +1,45 @@ +=== tests/cases/conformance/expressions/thisKeyword/thisInObjectLiterals.ts === +class MyClass { +>MyClass : Symbol(MyClass, Decl(thisInObjectLiterals.ts, 0, 0)) + + t: number; +>t : Symbol(MyClass.t, Decl(thisInObjectLiterals.ts, 0, 15)) + + fn() { +>fn : Symbol(MyClass.fn, Decl(thisInObjectLiterals.ts, 1, 14)) + + type ContainingThis = this; +>ContainingThis : Symbol(ContainingThis, Decl(thisInObjectLiterals.ts, 3, 10)) + + //type of 'this' in an object literal is the containing scope's this + var t = { x: this, y: this.t }; +>t : Symbol(t, Decl(thisInObjectLiterals.ts, 6, 11), Decl(thisInObjectLiterals.ts, 7, 11)) +>x : Symbol(x, Decl(thisInObjectLiterals.ts, 6, 17)) +>this : Symbol(MyClass, Decl(thisInObjectLiterals.ts, 0, 0)) +>y : Symbol(y, Decl(thisInObjectLiterals.ts, 6, 26)) +>this.t : Symbol(MyClass.t, Decl(thisInObjectLiterals.ts, 0, 15)) +>this : Symbol(MyClass, Decl(thisInObjectLiterals.ts, 0, 0)) +>t : Symbol(MyClass.t, Decl(thisInObjectLiterals.ts, 0, 15)) + + var t: { x: ContainingThis; y: number }; +>t : Symbol(t, Decl(thisInObjectLiterals.ts, 6, 11), Decl(thisInObjectLiterals.ts, 7, 11)) +>x : Symbol(x, Decl(thisInObjectLiterals.ts, 7, 16)) +>ContainingThis : Symbol(ContainingThis, Decl(thisInObjectLiterals.ts, 3, 10)) +>y : Symbol(y, Decl(thisInObjectLiterals.ts, 7, 35)) + } +} + +//type of 'this' in an object literal method is the type of the object literal +var obj = { +>obj : Symbol(obj, Decl(thisInObjectLiterals.ts, 12, 3), Decl(thisInObjectLiterals.ts, 17, 3)) + + f() { +>f : Symbol(f, Decl(thisInObjectLiterals.ts, 12, 11)) + + return this.spaaace; + } +}; +var obj: { f: () => any; }; +>obj : Symbol(obj, Decl(thisInObjectLiterals.ts, 12, 3), Decl(thisInObjectLiterals.ts, 17, 3)) +>f : Symbol(f, Decl(thisInObjectLiterals.ts, 17, 10)) + diff --git a/tests/baselines/reference/thisInObjectLiterals.types b/tests/baselines/reference/thisInObjectLiterals.types new file mode 100644 index 00000000000..b707a473dfb --- /dev/null +++ b/tests/baselines/reference/thisInObjectLiterals.types @@ -0,0 +1,50 @@ +=== tests/cases/conformance/expressions/thisKeyword/thisInObjectLiterals.ts === +class MyClass { +>MyClass : MyClass + + t: number; +>t : number + + fn() { +>fn : () => void + + type ContainingThis = this; +>ContainingThis : this + + //type of 'this' in an object literal is the containing scope's this + var t = { x: this, y: this.t }; +>t : { x: this; y: number; } +>{ x: this, y: this.t } : { x: this; y: number; } +>x : this +>this : this +>y : number +>this.t : number +>this : this +>t : number + + var t: { x: ContainingThis; y: number }; +>t : { x: this; y: number; } +>x : this +>ContainingThis : this +>y : number + } +} + +//type of 'this' in an object literal method is the type of the object literal +var obj = { +>obj : { f(): any; } +>{ f() { return this.spaaace; }} : { f(): any; } + + f() { +>f : () => any + + return this.spaaace; +>this.spaaace : any +>this : any +>spaaace : any + } +}; +var obj: { f: () => any; }; +>obj : { f(): any; } +>f : () => any + diff --git a/tests/baselines/reference/thisInPropertyBoundDeclarations.symbols b/tests/baselines/reference/thisInPropertyBoundDeclarations.symbols index 6afdd73f77f..12d3b2db31e 100644 --- a/tests/baselines/reference/thisInPropertyBoundDeclarations.symbols +++ b/tests/baselines/reference/thisInPropertyBoundDeclarations.symbols @@ -70,7 +70,6 @@ class A { a: function() { return this; }, >a : Symbol(a, Decl(thisInPropertyBoundDeclarations.ts, 33, 13)) ->this : Symbol(__object, Decl(thisInPropertyBoundDeclarations.ts, 33, 11)) }; @@ -80,7 +79,6 @@ class A { return { a: function() { return this; }, >a : Symbol(a, Decl(thisInPropertyBoundDeclarations.ts, 38, 16)) ->this : Symbol(__object, Decl(thisInPropertyBoundDeclarations.ts, 38, 14)) }; }; diff --git a/tests/baselines/reference/thisInPropertyBoundDeclarations.types b/tests/baselines/reference/thisInPropertyBoundDeclarations.types index 7c2b28bfb3e..b783c5c1b5f 100644 --- a/tests/baselines/reference/thisInPropertyBoundDeclarations.types +++ b/tests/baselines/reference/thisInPropertyBoundDeclarations.types @@ -84,9 +84,9 @@ class A { >{ a: function() { return this; }, } : { a: () => any; } a: function() { return this; }, ->a : () => { a: any; } ->function() { return this; } : () => { a: any; } ->this : { a: () => any; } +>a : () => any +>function() { return this; } : () => any +>this : any }; @@ -98,9 +98,9 @@ class A { >{ a: function() { return this; }, } : { a: () => any; } a: function() { return this; }, ->a : () => { a: any; } ->function() { return this; } : () => { a: any; } ->this : { a: () => any; } +>a : () => any +>function() { return this; } : () => any +>this : any }; }; diff --git a/tests/baselines/reference/thisTypeInFunctions2.errors.txt b/tests/baselines/reference/thisTypeInFunctions2.errors.txt new file mode 100644 index 00000000000..86721a76971 --- /dev/null +++ b/tests/baselines/reference/thisTypeInFunctions2.errors.txt @@ -0,0 +1,60 @@ +tests/cases/conformance/types/thisType/thisTypeInFunctions2.ts(15,5): error TS7010: 'foo', which lacks return-type annotation, implicitly has an 'any' return type. + + +==== tests/cases/conformance/types/thisType/thisTypeInFunctions2.ts (1 errors) ==== + + interface IndexedWithThis { + // this is a workaround for React + init?: (this: this) => void; + willDestroy?: (this: any) => void; + [propName: string]: number | string | boolean | symbol | undefined | null | {} | ((this: any, ...args:any[]) => any); + } + interface IndexedWithoutThis { + // this is what React would like to write (and what they write today) + init?: () => void; + willDestroy?: () => void; + [propName: string]: any; + } + interface SimpleInterface { + foo(n: string); + ~~~~~~~~~~~~~~~ +!!! error TS7010: 'foo', which lacks return-type annotation, implicitly has an 'any' return type. + bar(): number; + } + declare function extend1(args: IndexedWithThis): void; + declare function extend2(args: IndexedWithoutThis): void; + declare function simple(arg: SimpleInterface): void; + + extend1({ + init() { + this // this: IndexedWithThis because of contextual typing. + // this.mine + this.willDestroy + }, + mine: 12, + foo() { + this.url; // this: any because 'foo' matches the string indexer + this.willDestroy; + } + }); + extend2({ + init() { + this // this: containing object literal type + this.mine + }, + mine: 13, + foo() { + this // this: containing object literal type + this.mine + } + }); + + simple({ + foo(n) { + return n.length + this.bar(); + }, + bar() { + return 14; + } + }) + \ No newline at end of file diff --git a/tests/baselines/reference/thisTypeInFunctions2.js b/tests/baselines/reference/thisTypeInFunctions2.js index 978f79483b0..7608629ea89 100644 --- a/tests/baselines/reference/thisTypeInFunctions2.js +++ b/tests/baselines/reference/thisTypeInFunctions2.js @@ -1,4 +1,5 @@ //// [thisTypeInFunctions2.ts] + interface IndexedWithThis { // this is a workaround for React init?: (this: this) => void; diff --git a/tests/baselines/reference/thisTypeInObjectLiterals.js b/tests/baselines/reference/thisTypeInObjectLiterals.js index 342c9d58c84..18f0a6407bc 100644 --- a/tests/baselines/reference/thisTypeInObjectLiterals.js +++ b/tests/baselines/reference/thisTypeInObjectLiterals.js @@ -1,4 +1,5 @@ //// [thisTypeInObjectLiterals.ts] + let o = { d: "bar", m() { diff --git a/tests/baselines/reference/thisTypeInObjectLiterals.symbols b/tests/baselines/reference/thisTypeInObjectLiterals.symbols index fd6d6ecebd5..374c790bd8f 100644 --- a/tests/baselines/reference/thisTypeInObjectLiterals.symbols +++ b/tests/baselines/reference/thisTypeInObjectLiterals.symbols @@ -1,104 +1,105 @@ === tests/cases/conformance/types/thisType/thisTypeInObjectLiterals.ts === + let o = { ->o : Symbol(o, Decl(thisTypeInObjectLiterals.ts, 0, 3)) +>o : Symbol(o, Decl(thisTypeInObjectLiterals.ts, 1, 3)) d: "bar", ->d : Symbol(d, Decl(thisTypeInObjectLiterals.ts, 0, 9)) +>d : Symbol(d, Decl(thisTypeInObjectLiterals.ts, 1, 9)) m() { ->m : Symbol(m, Decl(thisTypeInObjectLiterals.ts, 1, 13)) +>m : Symbol(m, Decl(thisTypeInObjectLiterals.ts, 2, 13)) return this.d.length; >this.d.length : Symbol(String.length, Decl(lib.d.ts, --, --)) ->this.d : Symbol(d, Decl(thisTypeInObjectLiterals.ts, 0, 9)) ->this : Symbol(o, Decl(thisTypeInObjectLiterals.ts, 0, 7)) ->d : Symbol(d, Decl(thisTypeInObjectLiterals.ts, 0, 9)) +>this.d : Symbol(d, Decl(thisTypeInObjectLiterals.ts, 1, 9)) +>this : Symbol(o, Decl(thisTypeInObjectLiterals.ts, 1, 7)) +>d : Symbol(d, Decl(thisTypeInObjectLiterals.ts, 1, 9)) >length : Symbol(String.length, Decl(lib.d.ts, --, --)) }, f: function() { ->f : Symbol(f, Decl(thisTypeInObjectLiterals.ts, 4, 6)) +>f : Symbol(f, Decl(thisTypeInObjectLiterals.ts, 5, 6)) return this.d.length; >this.d.length : Symbol(String.length, Decl(lib.d.ts, --, --)) ->this.d : Symbol(d, Decl(thisTypeInObjectLiterals.ts, 0, 9)) ->this : Symbol(o, Decl(thisTypeInObjectLiterals.ts, 0, 7)) ->d : Symbol(d, Decl(thisTypeInObjectLiterals.ts, 0, 9)) +>this.d : Symbol(d, Decl(thisTypeInObjectLiterals.ts, 1, 9)) +>this : Symbol(o, Decl(thisTypeInObjectLiterals.ts, 1, 7)) +>d : Symbol(d, Decl(thisTypeInObjectLiterals.ts, 1, 9)) >length : Symbol(String.length, Decl(lib.d.ts, --, --)) } } let mutuallyRecursive = { ->mutuallyRecursive : Symbol(mutuallyRecursive, Decl(thisTypeInObjectLiterals.ts, 10, 3)) +>mutuallyRecursive : Symbol(mutuallyRecursive, Decl(thisTypeInObjectLiterals.ts, 11, 3)) a: 100, ->a : Symbol(a, Decl(thisTypeInObjectLiterals.ts, 10, 25)) +>a : Symbol(a, Decl(thisTypeInObjectLiterals.ts, 11, 25)) start() { ->start : Symbol(start, Decl(thisTypeInObjectLiterals.ts, 11, 11)) +>start : Symbol(start, Decl(thisTypeInObjectLiterals.ts, 12, 11)) return this.passthrough(this.a); ->this.passthrough : Symbol(passthrough, Decl(thisTypeInObjectLiterals.ts, 14, 6)) ->this : Symbol(mutuallyRecursive, Decl(thisTypeInObjectLiterals.ts, 10, 23)) ->passthrough : Symbol(passthrough, Decl(thisTypeInObjectLiterals.ts, 14, 6)) ->this.a : Symbol(a, Decl(thisTypeInObjectLiterals.ts, 10, 25)) ->this : Symbol(mutuallyRecursive, Decl(thisTypeInObjectLiterals.ts, 10, 23)) ->a : Symbol(a, Decl(thisTypeInObjectLiterals.ts, 10, 25)) +>this.passthrough : Symbol(passthrough, Decl(thisTypeInObjectLiterals.ts, 15, 6)) +>this : Symbol(mutuallyRecursive, Decl(thisTypeInObjectLiterals.ts, 11, 23)) +>passthrough : Symbol(passthrough, Decl(thisTypeInObjectLiterals.ts, 15, 6)) +>this.a : Symbol(a, Decl(thisTypeInObjectLiterals.ts, 11, 25)) +>this : Symbol(mutuallyRecursive, Decl(thisTypeInObjectLiterals.ts, 11, 23)) +>a : Symbol(a, Decl(thisTypeInObjectLiterals.ts, 11, 25)) }, passthrough(n: number) { ->passthrough : Symbol(passthrough, Decl(thisTypeInObjectLiterals.ts, 14, 6)) ->n : Symbol(n, Decl(thisTypeInObjectLiterals.ts, 15, 16)) +>passthrough : Symbol(passthrough, Decl(thisTypeInObjectLiterals.ts, 15, 6)) +>n : Symbol(n, Decl(thisTypeInObjectLiterals.ts, 16, 16)) return this.sub1(n); ->this.sub1 : Symbol(sub1, Decl(thisTypeInObjectLiterals.ts, 17, 6)) ->this : Symbol(mutuallyRecursive, Decl(thisTypeInObjectLiterals.ts, 10, 23)) ->sub1 : Symbol(sub1, Decl(thisTypeInObjectLiterals.ts, 17, 6)) ->n : Symbol(n, Decl(thisTypeInObjectLiterals.ts, 15, 16)) +>this.sub1 : Symbol(sub1, Decl(thisTypeInObjectLiterals.ts, 18, 6)) +>this : Symbol(mutuallyRecursive, Decl(thisTypeInObjectLiterals.ts, 11, 23)) +>sub1 : Symbol(sub1, Decl(thisTypeInObjectLiterals.ts, 18, 6)) +>n : Symbol(n, Decl(thisTypeInObjectLiterals.ts, 16, 16)) }, sub1(n: number): number { ->sub1 : Symbol(sub1, Decl(thisTypeInObjectLiterals.ts, 17, 6)) ->n : Symbol(n, Decl(thisTypeInObjectLiterals.ts, 18, 9)) +>sub1 : Symbol(sub1, Decl(thisTypeInObjectLiterals.ts, 18, 6)) +>n : Symbol(n, Decl(thisTypeInObjectLiterals.ts, 19, 9)) if (n > 0) { ->n : Symbol(n, Decl(thisTypeInObjectLiterals.ts, 18, 9)) +>n : Symbol(n, Decl(thisTypeInObjectLiterals.ts, 19, 9)) return this.passthrough(n - 1); ->this.passthrough : Symbol(passthrough, Decl(thisTypeInObjectLiterals.ts, 14, 6)) ->this : Symbol(mutuallyRecursive, Decl(thisTypeInObjectLiterals.ts, 10, 23)) ->passthrough : Symbol(passthrough, Decl(thisTypeInObjectLiterals.ts, 14, 6)) ->n : Symbol(n, Decl(thisTypeInObjectLiterals.ts, 18, 9)) +>this.passthrough : Symbol(passthrough, Decl(thisTypeInObjectLiterals.ts, 15, 6)) +>this : Symbol(mutuallyRecursive, Decl(thisTypeInObjectLiterals.ts, 11, 23)) +>passthrough : Symbol(passthrough, Decl(thisTypeInObjectLiterals.ts, 15, 6)) +>n : Symbol(n, Decl(thisTypeInObjectLiterals.ts, 19, 9)) } return n; ->n : Symbol(n, Decl(thisTypeInObjectLiterals.ts, 18, 9)) +>n : Symbol(n, Decl(thisTypeInObjectLiterals.ts, 19, 9)) } } var i: number = mutuallyRecursive.start(); ->i : Symbol(i, Decl(thisTypeInObjectLiterals.ts, 25, 3)) ->mutuallyRecursive.start : Symbol(start, Decl(thisTypeInObjectLiterals.ts, 11, 11)) ->mutuallyRecursive : Symbol(mutuallyRecursive, Decl(thisTypeInObjectLiterals.ts, 10, 3)) ->start : Symbol(start, Decl(thisTypeInObjectLiterals.ts, 11, 11)) +>i : Symbol(i, Decl(thisTypeInObjectLiterals.ts, 26, 3)) +>mutuallyRecursive.start : Symbol(start, Decl(thisTypeInObjectLiterals.ts, 12, 11)) +>mutuallyRecursive : Symbol(mutuallyRecursive, Decl(thisTypeInObjectLiterals.ts, 11, 3)) +>start : Symbol(start, Decl(thisTypeInObjectLiterals.ts, 12, 11)) interface I { ->I : Symbol(I, Decl(thisTypeInObjectLiterals.ts, 25, 42)) +>I : Symbol(I, Decl(thisTypeInObjectLiterals.ts, 26, 42)) a: number; ->a : Symbol(I.a, Decl(thisTypeInObjectLiterals.ts, 26, 13)) +>a : Symbol(I.a, Decl(thisTypeInObjectLiterals.ts, 27, 13)) start(): number; ->start : Symbol(I.start, Decl(thisTypeInObjectLiterals.ts, 27, 14)) +>start : Symbol(I.start, Decl(thisTypeInObjectLiterals.ts, 28, 14)) passthrough(n: number): number; ->passthrough : Symbol(I.passthrough, Decl(thisTypeInObjectLiterals.ts, 28, 20)) ->n : Symbol(n, Decl(thisTypeInObjectLiterals.ts, 29, 16)) +>passthrough : Symbol(I.passthrough, Decl(thisTypeInObjectLiterals.ts, 29, 20)) +>n : Symbol(n, Decl(thisTypeInObjectLiterals.ts, 30, 16)) sub1(n: number): number; ->sub1 : Symbol(I.sub1, Decl(thisTypeInObjectLiterals.ts, 29, 35)) ->n : Symbol(n, Decl(thisTypeInObjectLiterals.ts, 30, 9)) +>sub1 : Symbol(I.sub1, Decl(thisTypeInObjectLiterals.ts, 30, 35)) +>n : Symbol(n, Decl(thisTypeInObjectLiterals.ts, 31, 9)) } var impl: I = mutuallyRecursive; ->impl : Symbol(impl, Decl(thisTypeInObjectLiterals.ts, 32, 3)) ->I : Symbol(I, Decl(thisTypeInObjectLiterals.ts, 25, 42)) ->mutuallyRecursive : Symbol(mutuallyRecursive, Decl(thisTypeInObjectLiterals.ts, 10, 3)) +>impl : Symbol(impl, Decl(thisTypeInObjectLiterals.ts, 33, 3)) +>I : Symbol(I, Decl(thisTypeInObjectLiterals.ts, 26, 42)) +>mutuallyRecursive : Symbol(mutuallyRecursive, Decl(thisTypeInObjectLiterals.ts, 11, 3)) diff --git a/tests/baselines/reference/thisTypeInObjectLiterals.types b/tests/baselines/reference/thisTypeInObjectLiterals.types index d5c6d851faf..d4e6188b9cf 100644 --- a/tests/baselines/reference/thisTypeInObjectLiterals.types +++ b/tests/baselines/reference/thisTypeInObjectLiterals.types @@ -1,4 +1,5 @@ === tests/cases/conformance/types/thisType/thisTypeInObjectLiterals.ts === + let o = { >o : { d: string; m(): number; f: () => number; } >{ d: "bar", m() { return this.d.length; }, f: function() { return this.d.length; }} : { d: string; m(): number; f: () => number; } diff --git a/tests/baselines/reference/throwInEnclosingStatements.symbols b/tests/baselines/reference/throwInEnclosingStatements.symbols index 36dcd3cfcbd..63ed9dde578 100644 --- a/tests/baselines/reference/throwInEnclosingStatements.symbols +++ b/tests/baselines/reference/throwInEnclosingStatements.symbols @@ -89,7 +89,6 @@ var aa = { >biz : Symbol(biz, Decl(throwInEnclosingStatements.ts, 41, 10)) throw this; ->this : Symbol(aa, Decl(throwInEnclosingStatements.ts, 40, 8)) } } diff --git a/tests/baselines/reference/throwInEnclosingStatements.types b/tests/baselines/reference/throwInEnclosingStatements.types index d859bbd6392..2d99ac435ae 100644 --- a/tests/baselines/reference/throwInEnclosingStatements.types +++ b/tests/baselines/reference/throwInEnclosingStatements.types @@ -104,7 +104,7 @@ var aa = { >biz : () => void throw this; ->this : { id: number; biz(): void; } +>this : any } } diff --git a/tests/baselines/reference/underscoreTest1.symbols b/tests/baselines/reference/underscoreTest1.symbols index 3b578be8165..41b0c811027 100644 --- a/tests/baselines/reference/underscoreTest1.symbols +++ b/tests/baselines/reference/underscoreTest1.symbols @@ -395,16 +395,10 @@ var buttonView = { onClick: function () { alert('clicked: ' + this.label); }, >onClick : Symbol(onClick, Decl(underscoreTest1_underscoreTests.ts, 97, 24)) >alert : Symbol(alert, Decl(underscoreTest1_underscoreTests.ts, 2, 14)) ->this.label : Symbol(label, Decl(underscoreTest1_underscoreTests.ts, 96, 18)) ->this : Symbol(buttonView, Decl(underscoreTest1_underscoreTests.ts, 96, 16)) ->label : Symbol(label, Decl(underscoreTest1_underscoreTests.ts, 96, 18)) onHover: function () { alert('hovering: ' + this.label); } >onHover : Symbol(onHover, Decl(underscoreTest1_underscoreTests.ts, 98, 62)) >alert : Symbol(alert, Decl(underscoreTest1_underscoreTests.ts, 2, 14)) ->this.label : Symbol(label, Decl(underscoreTest1_underscoreTests.ts, 96, 18)) ->this : Symbol(buttonView, Decl(underscoreTest1_underscoreTests.ts, 96, 16)) ->label : Symbol(label, Decl(underscoreTest1_underscoreTests.ts, 96, 18)) }; _.bindAll(buttonView); diff --git a/tests/baselines/reference/underscoreTest1.types b/tests/baselines/reference/underscoreTest1.types index 26e30ae6f52..afcc807b756 100644 --- a/tests/baselines/reference/underscoreTest1.types +++ b/tests/baselines/reference/underscoreTest1.types @@ -827,9 +827,9 @@ var buttonView = { >alert : (x: string) => void >'clicked: ' + this.label : string >'clicked: ' : "clicked: " ->this.label : string ->this : { label: string; onClick: () => void; onHover: () => void; } ->label : string +>this.label : any +>this : any +>label : any onHover: function () { alert('hovering: ' + this.label); } >onHover : () => void @@ -838,9 +838,9 @@ var buttonView = { >alert : (x: string) => void >'hovering: ' + this.label : string >'hovering: ' : "hovering: " ->this.label : string ->this : { label: string; onClick: () => void; onHover: () => void; } ->label : string +>this.label : any +>this : any +>label : any }; _.bindAll(buttonView);