Accept new baselines

This commit is contained in:
Anders Hejlsberg 2017-02-16 17:47:58 -08:00
parent e512376b0c
commit d7e153d252
32 changed files with 317 additions and 149 deletions

View File

@ -71,7 +71,13 @@ var p_cast = <Point> ({
return new Point(this.x + dx, this.y + dy);
>Point : Symbol(Point, Decl(castTest.ts, 11, 37))
>this.x : Symbol(x, Decl(castTest.ts, 22, 23))
>this : Symbol(__object, Decl(castTest.ts, 22, 22))
>x : Symbol(x, Decl(castTest.ts, 22, 23))
>dx : Symbol(dx, Decl(castTest.ts, 25, 18))
>this.y : Symbol(y, Decl(castTest.ts, 23, 9))
>this : Symbol(__object, Decl(castTest.ts, 22, 22))
>y : Symbol(y, Decl(castTest.ts, 23, 9))
>dy : Symbol(dy, Decl(castTest.ts, 25, 21))
},

View File

@ -91,15 +91,15 @@ var p_cast = <Point> ({
return new Point(this.x + dx, this.y + dy);
>new Point(this.x + dx, this.y + dy) : Point
>Point : typeof Point
>this.x + dx : any
>this.x : any
>this : any
>x : any
>this.x + dx : number
>this.x : number
>this : { x: number; y: number; add: (dx: number, dy: number) => Point; mult: (p: Point) => Point; }
>x : number
>dx : number
>this.y + dy : any
>this.y : any
>this : any
>y : any
>this.y + dy : number
>this.y : number
>this : { x: number; y: number; add: (dx: number, dy: number) => Point; mult: (p: Point) => Point; }
>y : number
>dy : number
},

View File

@ -1,7 +1,8 @@
tests/cases/compiler/commentsOnObjectLiteral2.ts(1,14): error TS2304: Cannot find name 'makeClass'.
tests/cases/compiler/commentsOnObjectLiteral2.ts(9,17): error TS2339: Property 'name' does not exist on type '{ initialize: (name: any) => void; }'.
==== tests/cases/compiler/commentsOnObjectLiteral2.ts (1 errors) ====
==== tests/cases/compiler/commentsOnObjectLiteral2.ts (2 errors) ====
var Person = makeClass(
~~~~~~~~~
!!! error TS2304: Cannot find name 'makeClass'.
@ -13,6 +14,8 @@ tests/cases/compiler/commentsOnObjectLiteral2.ts(1,14): error TS2304: Cannot fin
*/
initialize: function(name) {
this.name = name;
~~~~
!!! error TS2339: Property 'name' does not exist on type '{ initialize: (name: any) => void; }'.
} /* trailing comment 1*/,
}
);

View File

@ -13,7 +13,7 @@ tests/cases/conformance/declarationEmit/typePredicates/declarationEmitThisPredic
m(): this is Foo {
~~~~
!!! error TS2526: A 'this' type is available only in a non-static member of a class or interface.
let dis = this as Foo;
let dis = this as {} as Foo;
return dis.a != null && dis.b != null && dis.c != null;
}
}

View File

@ -8,7 +8,7 @@ export interface Foo {
export const obj = {
m(): this is Foo {
let dis = this as Foo;
let dis = this as {} as Foo;
return dis.a != null && dis.b != null && dis.c != null;
}
}

View File

@ -16,7 +16,7 @@ tests/cases/conformance/declarationEmit/typePredicates/declarationEmitThisPredic
m(): this is Foo {
~~~~
!!! error TS2526: A 'this' type is available only in a non-static member of a class or interface.
let dis = this as Foo;
let dis = this as {} as Foo;
return dis.a != null && dis.b != null && dis.c != null;
}
}

View File

@ -8,7 +8,7 @@ interface Foo {
export const obj = {
m(): this is Foo {
let dis = this as Foo;
let dis = this as {} as Foo;
return dis.a != null && dis.b != null && dis.c != null;
}
}

View File

@ -163,6 +163,11 @@ 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(__object, Decl(fatarrowfunctions.ts, 38, 15))
>message : Symbol(message, Decl(fatarrowfunctions.ts, 38, 17))
>toString : Symbol(String.toString, Decl(lib.d.ts, --, --))
}
};

View File

@ -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() : any
>this.message.toString : any
>this.message : any
>this : any
>message : any
>toString : any
>this.message.toString() : string
>this.message.toString : () => string
>this.message : string
>this : { message: string; start: () => void; }
>message : string
>toString : () => string
>3000 : 3000
}
};

View File

@ -16,12 +16,17 @@ var messenger = {
var _self = this;
>_self : Symbol(_self, Decl(fatarrowfunctionsInFunctions.ts, 5, 11))
>this : Symbol(__object, 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);
}

View File

@ -18,8 +18,8 @@ var messenger = {
>function() { var _self = this; setTimeout(function() { _self.message.toString(); }, 3000); } : () => void
var _self = this;
>_self : any
>this : any
>_self : { message: string; start: () => void; }
>this : { message: string; start: () => void; }
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() : any
>_self.message.toString : any
>_self.message : any
>_self : any
>message : any
>toString : any
>_self.message.toString() : string
>_self.message.toString : () => string
>_self.message : string
>_self : { message: string; start: () => void; }
>message : string
>toString : () => string
}, 3000);
>3000 : 3000

View File

@ -41,19 +41,51 @@ tests/cases/conformance/fixSignatureCaching.ts(639,38): error TS2304: Cannot fin
tests/cases/conformance/fixSignatureCaching.ts(640,13): error TS2304: Cannot find name 'window'.
tests/cases/conformance/fixSignatureCaching.ts(641,13): error TS2304: Cannot find name 'window'.
tests/cases/conformance/fixSignatureCaching.ts(704,18): error TS2339: Property 'prepareDetectionCache' does not exist on type '{}'.
tests/cases/conformance/fixSignatureCaching.ts(704,45): error TS2339: Property '_cache' does not exist on type '{ constructor: (userAgent: any, maxPhoneWidth: any) => void; mobile: () => any; phone: () => any; tablet: () => any; userAgent: () => any; userAgents: () => any; os: () => any; version: (key: any) => any; versionStr: (key: any) => any; is: (key: any) => any; match: (pattern: any) => any; isPhoneSized: (maxPhoneWidth: any) => any; mobileGrade: () => any; }'.
tests/cases/conformance/fixSignatureCaching.ts(704,58): error TS2339: Property 'ua' does not exist on type '{ constructor: (userAgent: any, maxPhoneWidth: any) => void; mobile: () => any; phone: () => any; tablet: () => any; userAgent: () => any; userAgents: () => any; os: () => any; version: (key: any) => any; versionStr: (key: any) => any; is: (key: any) => any; match: (pattern: any) => any; isPhoneSized: (maxPhoneWidth: any) => any; mobileGrade: () => any; }'.
tests/cases/conformance/fixSignatureCaching.ts(704,67): error TS2339: Property 'maxPhoneWidth' does not exist on type '{ constructor: (userAgent: any, maxPhoneWidth: any) => void; mobile: () => any; phone: () => any; tablet: () => any; userAgent: () => any; userAgents: () => any; os: () => any; version: (key: any) => any; versionStr: (key: any) => any; is: (key: any) => any; match: (pattern: any) => any; isPhoneSized: (maxPhoneWidth: any) => any; mobileGrade: () => any; }'.
tests/cases/conformance/fixSignatureCaching.ts(705,25): error TS2339: Property '_cache' does not exist on type '{ constructor: (userAgent: any, maxPhoneWidth: any) => void; mobile: () => any; phone: () => any; tablet: () => any; userAgent: () => any; userAgents: () => any; os: () => any; version: (key: any) => any; versionStr: (key: any) => any; is: (key: any) => any; match: (pattern: any) => any; isPhoneSized: (maxPhoneWidth: any) => any; mobileGrade: () => any; }'.
tests/cases/conformance/fixSignatureCaching.ts(734,18): error TS2339: Property 'prepareDetectionCache' does not exist on type '{}'.
tests/cases/conformance/fixSignatureCaching.ts(734,45): error TS2339: Property '_cache' does not exist on type '{ constructor: (userAgent: any, maxPhoneWidth: any) => void; mobile: () => any; phone: () => any; tablet: () => any; userAgent: () => any; userAgents: () => any; os: () => any; version: (key: any) => any; versionStr: (key: any) => any; is: (key: any) => any; match: (pattern: any) => any; isPhoneSized: (maxPhoneWidth: any) => any; mobileGrade: () => any; }'.
tests/cases/conformance/fixSignatureCaching.ts(734,58): error TS2339: Property 'ua' does not exist on type '{ constructor: (userAgent: any, maxPhoneWidth: any) => void; mobile: () => any; phone: () => any; tablet: () => any; userAgent: () => any; userAgents: () => any; os: () => any; version: (key: any) => any; versionStr: (key: any) => any; is: (key: any) => any; match: (pattern: any) => any; isPhoneSized: (maxPhoneWidth: any) => any; mobileGrade: () => any; }'.
tests/cases/conformance/fixSignatureCaching.ts(734,67): error TS2339: Property 'maxPhoneWidth' does not exist on type '{ constructor: (userAgent: any, maxPhoneWidth: any) => void; mobile: () => any; phone: () => any; tablet: () => any; userAgent: () => any; userAgents: () => any; os: () => any; version: (key: any) => any; versionStr: (key: any) => any; is: (key: any) => any; match: (pattern: any) => any; isPhoneSized: (maxPhoneWidth: any) => any; mobileGrade: () => any; }'.
tests/cases/conformance/fixSignatureCaching.ts(735,25): error TS2339: Property '_cache' does not exist on type '{ constructor: (userAgent: any, maxPhoneWidth: any) => void; mobile: () => any; phone: () => any; tablet: () => any; userAgent: () => any; userAgents: () => any; os: () => any; version: (key: any) => any; versionStr: (key: any) => any; is: (key: any) => any; match: (pattern: any) => any; isPhoneSized: (maxPhoneWidth: any) => any; mobileGrade: () => any; }'.
tests/cases/conformance/fixSignatureCaching.ts(783,18): error TS2339: Property 'prepareDetectionCache' does not exist on type '{}'.
tests/cases/conformance/fixSignatureCaching.ts(783,45): error TS2339: Property '_cache' does not exist on type '{ constructor: (userAgent: any, maxPhoneWidth: any) => void; mobile: () => any; phone: () => any; tablet: () => any; userAgent: () => any; userAgents: () => any; os: () => any; version: (key: any) => any; versionStr: (key: any) => any; is: (key: any) => any; match: (pattern: any) => any; isPhoneSized: (maxPhoneWidth: any) => any; mobileGrade: () => any; }'.
tests/cases/conformance/fixSignatureCaching.ts(783,58): error TS2339: Property 'ua' does not exist on type '{ constructor: (userAgent: any, maxPhoneWidth: any) => void; mobile: () => any; phone: () => any; tablet: () => any; userAgent: () => any; userAgents: () => any; os: () => any; version: (key: any) => any; versionStr: (key: any) => any; is: (key: any) => any; match: (pattern: any) => any; isPhoneSized: (maxPhoneWidth: any) => any; mobileGrade: () => any; }'.
tests/cases/conformance/fixSignatureCaching.ts(783,67): error TS2339: Property 'maxPhoneWidth' does not exist on type '{ constructor: (userAgent: any, maxPhoneWidth: any) => void; mobile: () => any; phone: () => any; tablet: () => any; userAgent: () => any; userAgents: () => any; os: () => any; version: (key: any) => any; versionStr: (key: any) => any; is: (key: any) => any; match: (pattern: any) => any; isPhoneSized: (maxPhoneWidth: any) => any; mobileGrade: () => any; }'.
tests/cases/conformance/fixSignatureCaching.ts(784,25): error TS2339: Property '_cache' does not exist on type '{ constructor: (userAgent: any, maxPhoneWidth: any) => void; mobile: () => any; phone: () => any; tablet: () => any; userAgent: () => any; userAgents: () => any; os: () => any; version: (key: any) => any; versionStr: (key: any) => any; is: (key: any) => any; match: (pattern: any) => any; isPhoneSized: (maxPhoneWidth: any) => any; mobileGrade: () => any; }'.
tests/cases/conformance/fixSignatureCaching.ts(804,22): error TS2339: Property '_cache' does not exist on type '{ constructor: (userAgent: any, maxPhoneWidth: any) => void; mobile: () => any; phone: () => any; tablet: () => any; userAgent: () => any; userAgents: () => any; os: () => any; version: (key: any) => any; versionStr: (key: any) => any; is: (key: any) => any; match: (pattern: any) => any; isPhoneSized: (maxPhoneWidth: any) => any; mobileGrade: () => any; }'.
tests/cases/conformance/fixSignatureCaching.ts(805,22): error TS2339: Property '_cache' does not exist on type '{ constructor: (userAgent: any, maxPhoneWidth: any) => void; mobile: () => any; phone: () => any; tablet: () => any; userAgent: () => any; userAgents: () => any; os: () => any; version: (key: any) => any; versionStr: (key: any) => any; is: (key: any) => any; match: (pattern: any) => any; isPhoneSized: (maxPhoneWidth: any) => any; mobileGrade: () => any; }'.
tests/cases/conformance/fixSignatureCaching.ts(805,46): error TS2339: Property 'findMatch' does not exist on type '{}'.
tests/cases/conformance/fixSignatureCaching.ts(805,61): error TS2339: Property 'mobileDetectRules' does not exist on type '{}'.
tests/cases/conformance/fixSignatureCaching.ts(805,89): error TS2339: Property 'ua' does not exist on type '{ constructor: (userAgent: any, maxPhoneWidth: any) => void; mobile: () => any; phone: () => any; tablet: () => any; userAgent: () => any; userAgents: () => any; os: () => any; version: (key: any) => any; versionStr: (key: any) => any; is: (key: any) => any; match: (pattern: any) => any; isPhoneSized: (maxPhoneWidth: any) => any; mobileGrade: () => any; }'.
tests/cases/conformance/fixSignatureCaching.ts(807,25): error TS2339: Property '_cache' does not exist on type '{ constructor: (userAgent: any, maxPhoneWidth: any) => void; mobile: () => any; phone: () => any; tablet: () => any; userAgent: () => any; userAgents: () => any; os: () => any; version: (key: any) => any; versionStr: (key: any) => any; is: (key: any) => any; match: (pattern: any) => any; isPhoneSized: (maxPhoneWidth: any) => any; mobileGrade: () => any; }'.
tests/cases/conformance/fixSignatureCaching.ts(827,22): error TS2339: Property '_cache' does not exist on type '{ constructor: (userAgent: any, maxPhoneWidth: any) => void; mobile: () => any; phone: () => any; tablet: () => any; userAgent: () => any; userAgents: () => any; os: () => any; version: (key: any) => any; versionStr: (key: any) => any; is: (key: any) => any; match: (pattern: any) => any; isPhoneSized: (maxPhoneWidth: any) => any; mobileGrade: () => any; }'.
tests/cases/conformance/fixSignatureCaching.ts(828,22): error TS2339: Property '_cache' does not exist on type '{ constructor: (userAgent: any, maxPhoneWidth: any) => void; mobile: () => any; phone: () => any; tablet: () => any; userAgent: () => any; userAgents: () => any; os: () => any; version: (key: any) => any; versionStr: (key: any) => any; is: (key: any) => any; match: (pattern: any) => any; isPhoneSized: (maxPhoneWidth: any) => any; mobileGrade: () => any; }'.
tests/cases/conformance/fixSignatureCaching.ts(828,47): error TS2339: Property 'findMatches' does not exist on type '{}'.
tests/cases/conformance/fixSignatureCaching.ts(828,64): error TS2339: Property 'mobileDetectRules' does not exist on type '{}'.
tests/cases/conformance/fixSignatureCaching.ts(828,92): error TS2339: Property 'ua' does not exist on type '{ constructor: (userAgent: any, maxPhoneWidth: any) => void; mobile: () => any; phone: () => any; tablet: () => any; userAgent: () => any; userAgents: () => any; os: () => any; version: (key: any) => any; versionStr: (key: any) => any; is: (key: any) => any; match: (pattern: any) => any; isPhoneSized: (maxPhoneWidth: any) => any; mobileGrade: () => any; }'.
tests/cases/conformance/fixSignatureCaching.ts(830,25): error TS2339: Property '_cache' does not exist on type '{ constructor: (userAgent: any, maxPhoneWidth: any) => void; mobile: () => any; phone: () => any; tablet: () => any; userAgent: () => any; userAgents: () => any; os: () => any; version: (key: any) => any; versionStr: (key: any) => any; is: (key: any) => any; match: (pattern: any) => any; isPhoneSized: (maxPhoneWidth: any) => any; mobileGrade: () => any; }'.
tests/cases/conformance/fixSignatureCaching.ts(844,22): error TS2339: Property '_cache' does not exist on type '{ constructor: (userAgent: any, maxPhoneWidth: any) => void; mobile: () => any; phone: () => any; tablet: () => any; userAgent: () => any; userAgents: () => any; os: () => any; version: (key: any) => any; versionStr: (key: any) => any; is: (key: any) => any; match: (pattern: any) => any; isPhoneSized: (maxPhoneWidth: any) => any; mobileGrade: () => any; }'.
tests/cases/conformance/fixSignatureCaching.ts(845,22): error TS2339: Property '_cache' does not exist on type '{ constructor: (userAgent: any, maxPhoneWidth: any) => void; mobile: () => any; phone: () => any; tablet: () => any; userAgent: () => any; userAgents: () => any; os: () => any; version: (key: any) => any; versionStr: (key: any) => any; is: (key: any) => any; match: (pattern: any) => any; isPhoneSized: (maxPhoneWidth: any) => any; mobileGrade: () => any; }'.
tests/cases/conformance/fixSignatureCaching.ts(845,39): error TS2339: Property 'detectOS' does not exist on type '{}'.
tests/cases/conformance/fixSignatureCaching.ts(845,53): error TS2339: Property 'ua' does not exist on type '{ constructor: (userAgent: any, maxPhoneWidth: any) => void; mobile: () => any; phone: () => any; tablet: () => any; userAgent: () => any; userAgents: () => any; os: () => any; version: (key: any) => any; versionStr: (key: any) => any; is: (key: any) => any; match: (pattern: any) => any; isPhoneSized: (maxPhoneWidth: any) => any; mobileGrade: () => any; }'.
tests/cases/conformance/fixSignatureCaching.ts(847,25): error TS2339: Property '_cache' does not exist on type '{ constructor: (userAgent: any, maxPhoneWidth: any) => void; mobile: () => any; phone: () => any; tablet: () => any; userAgent: () => any; userAgents: () => any; os: () => any; version: (key: any) => any; versionStr: (key: any) => any; is: (key: any) => any; match: (pattern: any) => any; isPhoneSized: (maxPhoneWidth: any) => any; mobileGrade: () => any; }'.
tests/cases/conformance/fixSignatureCaching.ts(869,25): error TS2339: Property 'getVersion' does not exist on type '{}'.
tests/cases/conformance/fixSignatureCaching.ts(869,46): error TS2339: Property 'ua' does not exist on type '{ constructor: (userAgent: any, maxPhoneWidth: any) => void; mobile: () => any; phone: () => any; tablet: () => any; userAgent: () => any; userAgents: () => any; os: () => any; version: (key: any) => any; versionStr: (key: any) => any; is: (key: any) => any; match: (pattern: any) => any; isPhoneSized: (maxPhoneWidth: any) => any; mobileGrade: () => any; }'.
tests/cases/conformance/fixSignatureCaching.ts(890,25): error TS2339: Property 'getVersionStr' does not exist on type '{}'.
tests/cases/conformance/fixSignatureCaching.ts(890,49): error TS2339: Property 'ua' does not exist on type '{ constructor: (userAgent: any, maxPhoneWidth: any) => void; mobile: () => any; phone: () => any; tablet: () => any; userAgent: () => any; userAgents: () => any; os: () => any; version: (key: any) => any; versionStr: (key: any) => any; is: (key: any) => any; match: (pattern: any) => any; isPhoneSized: (maxPhoneWidth: any) => any; mobileGrade: () => any; }'.
tests/cases/conformance/fixSignatureCaching.ts(912,36): error TS2339: Property 'findMatches' does not exist on type '{}'.
tests/cases/conformance/fixSignatureCaching.ts(912,53): error TS2339: Property 'mobileDetectRules' does not exist on type '{}'.
tests/cases/conformance/fixSignatureCaching.ts(912,83): error TS2339: Property 'ua' does not exist on type '{ constructor: (userAgent: any, maxPhoneWidth: any) => void; mobile: () => any; phone: () => any; tablet: () => any; userAgent: () => any; userAgents: () => any; os: () => any; version: (key: any) => any; versionStr: (key: any) => any; is: (key: any) => any; match: (pattern: any) => any; isPhoneSized: (maxPhoneWidth: any) => any; mobileGrade: () => any; }'.
tests/cases/conformance/fixSignatureCaching.ts(927,38): error TS2339: Property 'ua' does not exist on type '{ constructor: (userAgent: any, maxPhoneWidth: any) => void; mobile: () => any; phone: () => any; tablet: () => any; userAgent: () => any; userAgents: () => any; os: () => any; version: (key: any) => any; versionStr: (key: any) => any; is: (key: any) => any; match: (pattern: any) => any; isPhoneSized: (maxPhoneWidth: any) => any; mobileGrade: () => any; }'.
tests/cases/conformance/fixSignatureCaching.ts(941,33): error TS2339: Property 'isPhoneSized' does not exist on type '(userAgent: any, maxPhoneWidth: any) => void'.
tests/cases/conformance/fixSignatureCaching.ts(941,68): error TS2339: Property 'maxPhoneWidth' does not exist on type '{ constructor: (userAgent: any, maxPhoneWidth: any) => void; mobile: () => any; phone: () => any; tablet: () => any; userAgent: () => any; userAgents: () => any; os: () => any; version: (key: any) => any; versionStr: (key: any) => any; is: (key: any) => any; match: (pattern: any) => any; isPhoneSized: (maxPhoneWidth: any) => any; mobileGrade: () => any; }'.
tests/cases/conformance/fixSignatureCaching.ts(951,22): error TS2339: Property '_cache' does not exist on type '{ constructor: (userAgent: any, maxPhoneWidth: any) => void; mobile: () => any; phone: () => any; tablet: () => any; userAgent: () => any; userAgents: () => any; os: () => any; version: (key: any) => any; versionStr: (key: any) => any; is: (key: any) => any; match: (pattern: any) => any; isPhoneSized: (maxPhoneWidth: any) => any; mobileGrade: () => any; }'.
tests/cases/conformance/fixSignatureCaching.ts(952,22): error TS2339: Property '_cache' does not exist on type '{ constructor: (userAgent: any, maxPhoneWidth: any) => void; mobile: () => any; phone: () => any; tablet: () => any; userAgent: () => any; userAgents: () => any; os: () => any; version: (key: any) => any; versionStr: (key: any) => any; is: (key: any) => any; match: (pattern: any) => any; isPhoneSized: (maxPhoneWidth: any) => any; mobileGrade: () => any; }'.
tests/cases/conformance/fixSignatureCaching.ts(952,42): error TS2339: Property 'mobileGrade' does not exist on type '{}'.
tests/cases/conformance/fixSignatureCaching.ts(954,25): error TS2339: Property '_cache' does not exist on type '{ constructor: (userAgent: any, maxPhoneWidth: any) => void; mobile: () => any; phone: () => any; tablet: () => any; userAgent: () => any; userAgents: () => any; os: () => any; version: (key: any) => any; versionStr: (key: any) => any; is: (key: any) => any; match: (pattern: any) => any; isPhoneSized: (maxPhoneWidth: any) => any; mobileGrade: () => any; }'.
tests/cases/conformance/fixSignatureCaching.ts(959,16): error TS2304: Cannot find name 'window'.
tests/cases/conformance/fixSignatureCaching.ts(959,42): error TS2304: Cannot find name 'window'.
tests/cases/conformance/fixSignatureCaching.ts(960,22): error TS2339: Property 'isPhoneSized' does not exist on type '(userAgent: any, maxPhoneWidth: any) => void'.
@ -71,7 +103,7 @@ tests/cases/conformance/fixSignatureCaching.ts(979,23): error TS2304: Cannot fin
tests/cases/conformance/fixSignatureCaching.ts(980,37): error TS2304: Cannot find name 'window'.
==== tests/cases/conformance/fixSignatureCaching.ts (71 errors) ====
==== tests/cases/conformance/fixSignatureCaching.ts (103 errors) ====
// Repro from #10697
(function (define, undefined) {
@ -862,7 +894,15 @@ tests/cases/conformance/fixSignatureCaching.ts(980,37): error TS2304: Cannot fin
impl.prepareDetectionCache(this._cache, this.ua, this.maxPhoneWidth);
~~~~~~~~~~~~~~~~~~~~~
!!! error TS2339: Property 'prepareDetectionCache' does not exist on type '{}'.
~~~~~~
!!! error TS2339: Property '_cache' does not exist on type '{ constructor: (userAgent: any, maxPhoneWidth: any) => void; mobile: () => any; phone: () => any; tablet: () => any; userAgent: () => any; userAgents: () => any; os: () => any; version: (key: any) => any; versionStr: (key: any) => any; is: (key: any) => any; match: (pattern: any) => any; isPhoneSized: (maxPhoneWidth: any) => any; mobileGrade: () => any; }'.
~~
!!! error TS2339: Property 'ua' does not exist on type '{ constructor: (userAgent: any, maxPhoneWidth: any) => void; mobile: () => any; phone: () => any; tablet: () => any; userAgent: () => any; userAgents: () => any; os: () => any; version: (key: any) => any; versionStr: (key: any) => any; is: (key: any) => any; match: (pattern: any) => any; isPhoneSized: (maxPhoneWidth: any) => any; mobileGrade: () => any; }'.
~~~~~~~~~~~~~
!!! error TS2339: Property 'maxPhoneWidth' does not exist on type '{ constructor: (userAgent: any, maxPhoneWidth: any) => void; mobile: () => any; phone: () => any; tablet: () => any; userAgent: () => any; userAgents: () => any; os: () => any; version: (key: any) => any; versionStr: (key: any) => any; is: (key: any) => any; match: (pattern: any) => any; isPhoneSized: (maxPhoneWidth: any) => any; mobileGrade: () => any; }'.
return this._cache.mobile;
~~~~~~
!!! error TS2339: Property '_cache' does not exist on type '{ constructor: (userAgent: any, maxPhoneWidth: any) => void; mobile: () => any; phone: () => any; tablet: () => any; userAgent: () => any; userAgents: () => any; os: () => any; version: (key: any) => any; versionStr: (key: any) => any; is: (key: any) => any; match: (pattern: any) => any; isPhoneSized: (maxPhoneWidth: any) => any; mobileGrade: () => any; }'.
},
/**
@ -894,7 +934,15 @@ tests/cases/conformance/fixSignatureCaching.ts(980,37): error TS2304: Cannot fin
impl.prepareDetectionCache(this._cache, this.ua, this.maxPhoneWidth);
~~~~~~~~~~~~~~~~~~~~~
!!! error TS2339: Property 'prepareDetectionCache' does not exist on type '{}'.
~~~~~~
!!! error TS2339: Property '_cache' does not exist on type '{ constructor: (userAgent: any, maxPhoneWidth: any) => void; mobile: () => any; phone: () => any; tablet: () => any; userAgent: () => any; userAgents: () => any; os: () => any; version: (key: any) => any; versionStr: (key: any) => any; is: (key: any) => any; match: (pattern: any) => any; isPhoneSized: (maxPhoneWidth: any) => any; mobileGrade: () => any; }'.
~~
!!! error TS2339: Property 'ua' does not exist on type '{ constructor: (userAgent: any, maxPhoneWidth: any) => void; mobile: () => any; phone: () => any; tablet: () => any; userAgent: () => any; userAgents: () => any; os: () => any; version: (key: any) => any; versionStr: (key: any) => any; is: (key: any) => any; match: (pattern: any) => any; isPhoneSized: (maxPhoneWidth: any) => any; mobileGrade: () => any; }'.
~~~~~~~~~~~~~
!!! error TS2339: Property 'maxPhoneWidth' does not exist on type '{ constructor: (userAgent: any, maxPhoneWidth: any) => void; mobile: () => any; phone: () => any; tablet: () => any; userAgent: () => any; userAgents: () => any; os: () => any; version: (key: any) => any; versionStr: (key: any) => any; is: (key: any) => any; match: (pattern: any) => any; isPhoneSized: (maxPhoneWidth: any) => any; mobileGrade: () => any; }'.
return this._cache.phone;
~~~~~~
!!! error TS2339: Property '_cache' does not exist on type '{ constructor: (userAgent: any, maxPhoneWidth: any) => void; mobile: () => any; phone: () => any; tablet: () => any; userAgent: () => any; userAgents: () => any; os: () => any; version: (key: any) => any; versionStr: (key: any) => any; is: (key: any) => any; match: (pattern: any) => any; isPhoneSized: (maxPhoneWidth: any) => any; mobileGrade: () => any; }'.
},
/**
@ -945,7 +993,15 @@ tests/cases/conformance/fixSignatureCaching.ts(980,37): error TS2304: Cannot fin
impl.prepareDetectionCache(this._cache, this.ua, this.maxPhoneWidth);
~~~~~~~~~~~~~~~~~~~~~
!!! error TS2339: Property 'prepareDetectionCache' does not exist on type '{}'.
~~~~~~
!!! error TS2339: Property '_cache' does not exist on type '{ constructor: (userAgent: any, maxPhoneWidth: any) => void; mobile: () => any; phone: () => any; tablet: () => any; userAgent: () => any; userAgents: () => any; os: () => any; version: (key: any) => any; versionStr: (key: any) => any; is: (key: any) => any; match: (pattern: any) => any; isPhoneSized: (maxPhoneWidth: any) => any; mobileGrade: () => any; }'.
~~
!!! error TS2339: Property 'ua' does not exist on type '{ constructor: (userAgent: any, maxPhoneWidth: any) => void; mobile: () => any; phone: () => any; tablet: () => any; userAgent: () => any; userAgents: () => any; os: () => any; version: (key: any) => any; versionStr: (key: any) => any; is: (key: any) => any; match: (pattern: any) => any; isPhoneSized: (maxPhoneWidth: any) => any; mobileGrade: () => any; }'.
~~~~~~~~~~~~~
!!! error TS2339: Property 'maxPhoneWidth' does not exist on type '{ constructor: (userAgent: any, maxPhoneWidth: any) => void; mobile: () => any; phone: () => any; tablet: () => any; userAgent: () => any; userAgents: () => any; os: () => any; version: (key: any) => any; versionStr: (key: any) => any; is: (key: any) => any; match: (pattern: any) => any; isPhoneSized: (maxPhoneWidth: any) => any; mobileGrade: () => any; }'.
return this._cache.tablet;
~~~~~~
!!! error TS2339: Property '_cache' does not exist on type '{ constructor: (userAgent: any, maxPhoneWidth: any) => void; mobile: () => any; phone: () => any; tablet: () => any; userAgent: () => any; userAgents: () => any; os: () => any; version: (key: any) => any; versionStr: (key: any) => any; is: (key: any) => any; match: (pattern: any) => any; isPhoneSized: (maxPhoneWidth: any) => any; mobileGrade: () => any; }'.
},
/**
@ -966,13 +1022,21 @@ tests/cases/conformance/fixSignatureCaching.ts(980,37): error TS2304: Cannot fin
*/
userAgent: function () {
if (this._cache.userAgent === undefined) {
~~~~~~
!!! error TS2339: Property '_cache' does not exist on type '{ constructor: (userAgent: any, maxPhoneWidth: any) => void; mobile: () => any; phone: () => any; tablet: () => any; userAgent: () => any; userAgents: () => any; os: () => any; version: (key: any) => any; versionStr: (key: any) => any; is: (key: any) => any; match: (pattern: any) => any; isPhoneSized: (maxPhoneWidth: any) => any; mobileGrade: () => any; }'.
this._cache.userAgent = impl.findMatch(impl.mobileDetectRules.uas, this.ua);
~~~~~~
!!! error TS2339: Property '_cache' does not exist on type '{ constructor: (userAgent: any, maxPhoneWidth: any) => void; mobile: () => any; phone: () => any; tablet: () => any; userAgent: () => any; userAgents: () => any; os: () => any; version: (key: any) => any; versionStr: (key: any) => any; is: (key: any) => any; match: (pattern: any) => any; isPhoneSized: (maxPhoneWidth: any) => any; mobileGrade: () => any; }'.
~~~~~~~~~
!!! error TS2339: Property 'findMatch' does not exist on type '{}'.
~~~~~~~~~~~~~~~~~
!!! error TS2339: Property 'mobileDetectRules' does not exist on type '{}'.
~~
!!! error TS2339: Property 'ua' does not exist on type '{ constructor: (userAgent: any, maxPhoneWidth: any) => void; mobile: () => any; phone: () => any; tablet: () => any; userAgent: () => any; userAgents: () => any; os: () => any; version: (key: any) => any; versionStr: (key: any) => any; is: (key: any) => any; match: (pattern: any) => any; isPhoneSized: (maxPhoneWidth: any) => any; mobileGrade: () => any; }'.
}
return this._cache.userAgent;
~~~~~~
!!! error TS2339: Property '_cache' does not exist on type '{ constructor: (userAgent: any, maxPhoneWidth: any) => void; mobile: () => any; phone: () => any; tablet: () => any; userAgent: () => any; userAgents: () => any; os: () => any; version: (key: any) => any; versionStr: (key: any) => any; is: (key: any) => any; match: (pattern: any) => any; isPhoneSized: (maxPhoneWidth: any) => any; mobileGrade: () => any; }'.
},
/**
@ -993,13 +1057,21 @@ tests/cases/conformance/fixSignatureCaching.ts(980,37): error TS2304: Cannot fin
*/
userAgents: function () {
if (this._cache.userAgents === undefined) {
~~~~~~
!!! error TS2339: Property '_cache' does not exist on type '{ constructor: (userAgent: any, maxPhoneWidth: any) => void; mobile: () => any; phone: () => any; tablet: () => any; userAgent: () => any; userAgents: () => any; os: () => any; version: (key: any) => any; versionStr: (key: any) => any; is: (key: any) => any; match: (pattern: any) => any; isPhoneSized: (maxPhoneWidth: any) => any; mobileGrade: () => any; }'.
this._cache.userAgents = impl.findMatches(impl.mobileDetectRules.uas, this.ua);
~~~~~~
!!! error TS2339: Property '_cache' does not exist on type '{ constructor: (userAgent: any, maxPhoneWidth: any) => void; mobile: () => any; phone: () => any; tablet: () => any; userAgent: () => any; userAgents: () => any; os: () => any; version: (key: any) => any; versionStr: (key: any) => any; is: (key: any) => any; match: (pattern: any) => any; isPhoneSized: (maxPhoneWidth: any) => any; mobileGrade: () => any; }'.
~~~~~~~~~~~
!!! error TS2339: Property 'findMatches' does not exist on type '{}'.
~~~~~~~~~~~~~~~~~
!!! error TS2339: Property 'mobileDetectRules' does not exist on type '{}'.
~~
!!! error TS2339: Property 'ua' does not exist on type '{ constructor: (userAgent: any, maxPhoneWidth: any) => void; mobile: () => any; phone: () => any; tablet: () => any; userAgent: () => any; userAgents: () => any; os: () => any; version: (key: any) => any; versionStr: (key: any) => any; is: (key: any) => any; match: (pattern: any) => any; isPhoneSized: (maxPhoneWidth: any) => any; mobileGrade: () => any; }'.
}
return this._cache.userAgents;
~~~~~~
!!! error TS2339: Property '_cache' does not exist on type '{ constructor: (userAgent: any, maxPhoneWidth: any) => void; mobile: () => any; phone: () => any; tablet: () => any; userAgent: () => any; userAgents: () => any; os: () => any; version: (key: any) => any; versionStr: (key: any) => any; is: (key: any) => any; match: (pattern: any) => any; isPhoneSized: (maxPhoneWidth: any) => any; mobileGrade: () => any; }'.
},
/**
@ -1014,11 +1086,19 @@ tests/cases/conformance/fixSignatureCaching.ts(980,37): error TS2304: Cannot fin
*/
os: function () {
if (this._cache.os === undefined) {
~~~~~~
!!! error TS2339: Property '_cache' does not exist on type '{ constructor: (userAgent: any, maxPhoneWidth: any) => void; mobile: () => any; phone: () => any; tablet: () => any; userAgent: () => any; userAgents: () => any; os: () => any; version: (key: any) => any; versionStr: (key: any) => any; is: (key: any) => any; match: (pattern: any) => any; isPhoneSized: (maxPhoneWidth: any) => any; mobileGrade: () => any; }'.
this._cache.os = impl.detectOS(this.ua);
~~~~~~
!!! error TS2339: Property '_cache' does not exist on type '{ constructor: (userAgent: any, maxPhoneWidth: any) => void; mobile: () => any; phone: () => any; tablet: () => any; userAgent: () => any; userAgents: () => any; os: () => any; version: (key: any) => any; versionStr: (key: any) => any; is: (key: any) => any; match: (pattern: any) => any; isPhoneSized: (maxPhoneWidth: any) => any; mobileGrade: () => any; }'.
~~~~~~~~
!!! error TS2339: Property 'detectOS' does not exist on type '{}'.
~~
!!! error TS2339: Property 'ua' does not exist on type '{ constructor: (userAgent: any, maxPhoneWidth: any) => void; mobile: () => any; phone: () => any; tablet: () => any; userAgent: () => any; userAgents: () => any; os: () => any; version: (key: any) => any; versionStr: (key: any) => any; is: (key: any) => any; match: (pattern: any) => any; isPhoneSized: (maxPhoneWidth: any) => any; mobileGrade: () => any; }'.
}
return this._cache.os;
~~~~~~
!!! error TS2339: Property '_cache' does not exist on type '{ constructor: (userAgent: any, maxPhoneWidth: any) => void; mobile: () => any; phone: () => any; tablet: () => any; userAgent: () => any; userAgents: () => any; os: () => any; version: (key: any) => any; versionStr: (key: any) => any; is: (key: any) => any; match: (pattern: any) => any; isPhoneSized: (maxPhoneWidth: any) => any; mobileGrade: () => any; }'.
},
/**
@ -1043,6 +1123,8 @@ tests/cases/conformance/fixSignatureCaching.ts(980,37): error TS2304: Cannot fin
return impl.getVersion(key, this.ua);
~~~~~~~~~~
!!! error TS2339: Property 'getVersion' does not exist on type '{}'.
~~
!!! error TS2339: Property 'ua' does not exist on type '{ constructor: (userAgent: any, maxPhoneWidth: any) => void; mobile: () => any; phone: () => any; tablet: () => any; userAgent: () => any; userAgents: () => any; os: () => any; version: (key: any) => any; versionStr: (key: any) => any; is: (key: any) => any; match: (pattern: any) => any; isPhoneSized: (maxPhoneWidth: any) => any; mobileGrade: () => any; }'.
},
/**
@ -1066,6 +1148,8 @@ tests/cases/conformance/fixSignatureCaching.ts(980,37): error TS2304: Cannot fin
return impl.getVersionStr(key, this.ua);
~~~~~~~~~~~~~
!!! error TS2339: Property 'getVersionStr' does not exist on type '{}'.
~~
!!! error TS2339: Property 'ua' does not exist on type '{ constructor: (userAgent: any, maxPhoneWidth: any) => void; mobile: () => any; phone: () => any; tablet: () => any; userAgent: () => any; userAgents: () => any; os: () => any; version: (key: any) => any; versionStr: (key: any) => any; is: (key: any) => any; match: (pattern: any) => any; isPhoneSized: (maxPhoneWidth: any) => any; mobileGrade: () => any; }'.
},
/**
@ -1092,6 +1176,8 @@ tests/cases/conformance/fixSignatureCaching.ts(980,37): error TS2304: Cannot fin
!!! error TS2339: Property 'findMatches' does not exist on type '{}'.
~~~~~~~~~~~~~~~~~
!!! error TS2339: Property 'mobileDetectRules' does not exist on type '{}'.
~~
!!! error TS2339: Property 'ua' does not exist on type '{ constructor: (userAgent: any, maxPhoneWidth: any) => void; mobile: () => any; phone: () => any; tablet: () => any; userAgent: () => any; userAgents: () => any; os: () => any; version: (key: any) => any; versionStr: (key: any) => any; is: (key: any) => any; match: (pattern: any) => any; isPhoneSized: (maxPhoneWidth: any) => any; mobileGrade: () => any; }'.
},
/**
@ -1107,6 +1193,8 @@ tests/cases/conformance/fixSignatureCaching.ts(980,37): error TS2304: Cannot fin
pattern = new RegExp(pattern, 'i');
}
return pattern.test(this.ua);
~~
!!! error TS2339: Property 'ua' does not exist on type '{ constructor: (userAgent: any, maxPhoneWidth: any) => void; mobile: () => any; phone: () => any; tablet: () => any; userAgent: () => any; userAgents: () => any; os: () => any; version: (key: any) => any; versionStr: (key: any) => any; is: (key: any) => any; match: (pattern: any) => any; isPhoneSized: (maxPhoneWidth: any) => any; mobileGrade: () => any; }'.
},
/**
@ -1123,6 +1211,8 @@ tests/cases/conformance/fixSignatureCaching.ts(980,37): error TS2304: Cannot fin
return MobileDetect.isPhoneSized(maxPhoneWidth || this.maxPhoneWidth);
~~~~~~~~~~~~
!!! error TS2339: Property 'isPhoneSized' does not exist on type '(userAgent: any, maxPhoneWidth: any) => void'.
~~~~~~~~~~~~~
!!! error TS2339: Property 'maxPhoneWidth' does not exist on type '{ constructor: (userAgent: any, maxPhoneWidth: any) => void; mobile: () => any; phone: () => any; tablet: () => any; userAgent: () => any; userAgents: () => any; os: () => any; version: (key: any) => any; versionStr: (key: any) => any; is: (key: any) => any; match: (pattern: any) => any; isPhoneSized: (maxPhoneWidth: any) => any; mobileGrade: () => any; }'.
},
/**
@ -1133,11 +1223,17 @@ tests/cases/conformance/fixSignatureCaching.ts(980,37): error TS2304: Cannot fin
*/
mobileGrade: function () {
if (this._cache.grade === undefined) {
~~~~~~
!!! error TS2339: Property '_cache' does not exist on type '{ constructor: (userAgent: any, maxPhoneWidth: any) => void; mobile: () => any; phone: () => any; tablet: () => any; userAgent: () => any; userAgents: () => any; os: () => any; version: (key: any) => any; versionStr: (key: any) => any; is: (key: any) => any; match: (pattern: any) => any; isPhoneSized: (maxPhoneWidth: any) => any; mobileGrade: () => any; }'.
this._cache.grade = impl.mobileGrade(this);
~~~~~~
!!! error TS2339: Property '_cache' does not exist on type '{ constructor: (userAgent: any, maxPhoneWidth: any) => void; mobile: () => any; phone: () => any; tablet: () => any; userAgent: () => any; userAgents: () => any; os: () => any; version: (key: any) => any; versionStr: (key: any) => any; is: (key: any) => any; match: (pattern: any) => any; isPhoneSized: (maxPhoneWidth: any) => any; mobileGrade: () => any; }'.
~~~~~~~~~~~
!!! error TS2339: Property 'mobileGrade' does not exist on type '{}'.
}
return this._cache.grade;
~~~~~~
!!! error TS2339: Property '_cache' does not exist on type '{ constructor: (userAgent: any, maxPhoneWidth: any) => void; mobile: () => any; phone: () => any; tablet: () => any; userAgent: () => any; userAgents: () => any; os: () => any; version: (key: any) => any; versionStr: (key: any) => any; is: (key: any) => any; match: (pattern: any) => any; isPhoneSized: (maxPhoneWidth: any) => any; mobileGrade: () => any; }'.
}
};

View File

@ -1,12 +1,13 @@
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'.
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 (4 errors) ====
==== tests/cases/conformance/types/thisType/looseThisTypeInFunctions.ts (5 errors) ====
interface I {
n: number;
explicitThis(this: this, m: number): number;
@ -36,6 +37,8 @@ tests/cases/conformance/types/thisType/looseThisTypeInFunctions.ts(46,20): error
n: 101,
explicitThis: function (m: number) {
return m + this.n.length; // error, 'length' does not exist on 'number'
~~~~~~
!!! error TS2339: Property 'length' does not exist on type 'number'.
},
implicitThis(m: number): number { return m; }
};

View File

@ -200,6 +200,9 @@ 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(C.p, Decl(objectSpread.ts, 44, 9))
>this : Symbol(__object, Decl(objectSpread.ts, 49, 40))
>p : Symbol(C.p, Decl(objectSpread.ts, 44, 9))
cplus.plus();
>cplus.plus : Symbol(plus, Decl(objectSpread.ts, 49, 23))

View File

@ -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(): any; p: number; }
>{ ...c, plus() { return this.p + 1; } } : { plus(): number; p: number; }
>c : C
>plus : () => any
>this.p + 1 : any
>this.p : any
>this : any
>p : any
>plus : () => number
>this.p + 1 : number
>this.p : number
>this : { plus(): number; p: number; }
>p : number
>1 : 1
cplus.plus();

View File

@ -37,8 +37,15 @@ var o = {
>onmousemove : Symbol(Window.onmousemove, Decl(selfInLambdas.ts, 6, 18))
this.counter++
>this.counter : Symbol(counter, Decl(selfInLambdas.ts, 10, 9))
>this : Symbol(__object, Decl(selfInLambdas.ts, 10, 7))
>counter : Symbol(counter, Decl(selfInLambdas.ts, 10, 9))
var f = () => this.counter;
>f : Symbol(f, Decl(selfInLambdas.ts, 18, 15))
>this.counter : Symbol(counter, Decl(selfInLambdas.ts, 10, 9))
>this : Symbol(__object, Decl(selfInLambdas.ts, 10, 7))
>counter : Symbol(counter, Decl(selfInLambdas.ts, 10, 9))
}

View File

@ -43,16 +43,16 @@ var o = {
this.counter++
>this.counter++ : number
>this.counter : any
>this : any
>counter : any
>this.counter : number
>this : { counter: number; start: () => void; }
>counter : number
var f = () => this.counter;
>f : () => any
>() => this.counter : () => any
>this.counter : any
>this : any
>counter : any
>f : () => number
>() => this.counter : () => number
>this.counter : number
>this : { counter: number; start: () => void; }
>counter : number
}

View File

@ -50,6 +50,9 @@ var messenger = {
return setTimeout(() => { var x = this.message; }, 3000);
>setTimeout : Symbol(setTimeout, Decl(thisBinding2.ts, 12, 1))
>x : Symbol(x, Decl(thisBinding2.ts, 17, 37))
>this.message : Symbol(message, Decl(thisBinding2.ts, 14, 17))
>this : Symbol(__object, Decl(thisBinding2.ts, 14, 15))
>message : Symbol(message, Decl(thisBinding2.ts, 14, 17))
}
};

View File

@ -67,10 +67,10 @@ var messenger = {
>setTimeout(() => { var x = this.message; }, 3000) : number
>setTimeout : (expression: any, msec?: number, language?: any) => number
>() => { var x = this.message; } : () => void
>x : any
>this.message : any
>this : any
>message : any
>x : string
>this.message : string
>this : { message: string; start: () => number; }
>message : string
>3000 : 3000
}
};

View File

@ -1,4 +1,4 @@
tests/cases/conformance/expressions/thisKeyword/thisInObjectLiterals.ts(7,13): error TS2403: Subsequent variable declarations must have the same type. Variable 't' must be of type '{ x: this; y: number; }', but here has type '{ x: MyClass; y: number; }'.
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) ====
@ -6,11 +6,10 @@ tests/cases/conformance/expressions/thisKeyword/thisInObjectLiterals.ts(7,13): e
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: MyClass; y: number };
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 't' must be of type '{ x: this; y: number; }', but here has type '{ x: MyClass; y: number; }'.
var t: { x: ContainingThis; y: number };
}
}
@ -18,6 +17,8 @@ tests/cases/conformance/expressions/thisKeyword/thisInObjectLiterals.ts(7,13): e
var obj = {
f() {
return this.spaaace;
~~~~~~~
!!! error TS2339: Property 'spaaace' does not exist on type '{ f(): any; }'.
}
};
var obj: { f: () => any; };

View File

@ -3,9 +3,10 @@ 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: MyClass; y: number };
var t: { x: ContainingThis; y: number };
}
}

View File

@ -70,6 +70,7 @@ class A {
a: function() { return this; },
>a : Symbol(a, Decl(thisInPropertyBoundDeclarations.ts, 33, 13))
>this : Symbol(__object, Decl(thisInPropertyBoundDeclarations.ts, 33, 11))
};
@ -79,6 +80,7 @@ class A {
return {
a: function() { return this; },
>a : Symbol(a, Decl(thisInPropertyBoundDeclarations.ts, 38, 16))
>this : Symbol(__object, Decl(thisInPropertyBoundDeclarations.ts, 38, 14))
};
};

View File

@ -84,9 +84,9 @@ class A {
>{ a: function() { return this; }, } : { a: () => any; }
a: function() { return this; },
>a : () => any
>function() { return this; } : () => any
>this : any
>a : () => { a: any; }
>function() { return this; } : () => { a: any; }
>this : { a: () => any; }
};
@ -98,9 +98,9 @@ class A {
>{ a: function() { return this; }, } : { a: () => any; }
a: function() { return this; },
>a : () => any
>function() { return this; } : () => any
>this : any
>a : () => { a: any; }
>function() { return this; } : () => { a: any; }
>this : { a: () => any; }
};
};

View File

@ -33,15 +33,14 @@ extend1({
});
extend2({
init() {
this // this: any because the contextual signature of init doesn't specify this' type
this // this: containing object literal type
this.mine
this.willDestroy
//this.willDestroy
},
mine: 13,
foo() {
this // this: any because of the string indexer
this // this: containing object literal type
this.mine
this.willDestroy
}
});
@ -70,15 +69,14 @@ extend1({
});
extend2({
init: function () {
this; // this: any because the contextual signature of init doesn't specify this' type
this; // this: containing object literal type
this.mine;
this.willDestroy;
//this.willDestroy
},
mine: 13,
foo: function () {
this; // this: any because of the string indexer
this; // this: containing object literal type
this.mine;
this.willDestroy;
}
});
simple({

View File

@ -89,9 +89,15 @@ extend2({
init() {
>init : Symbol(init, Decl(thisTypeInFunctions2.ts, 32, 9))
this // this: any because the contextual signature of init doesn't specify this' type
this // this: containing object literal type
>this : Symbol(__object, Decl(thisTypeInFunctions2.ts, 32, 8))
this.mine
this.willDestroy
>this.mine : Symbol(mine, Decl(thisTypeInFunctions2.ts, 37, 6))
>this : Symbol(__object, Decl(thisTypeInFunctions2.ts, 32, 8))
>mine : Symbol(mine, Decl(thisTypeInFunctions2.ts, 37, 6))
//this.willDestroy
},
mine: 13,
>mine : Symbol(mine, Decl(thisTypeInFunctions2.ts, 37, 6))
@ -99,9 +105,13 @@ extend2({
foo() {
>foo : Symbol(foo, Decl(thisTypeInFunctions2.ts, 38, 13))
this // this: any because of the string indexer
this // this: containing object literal type
>this : Symbol(__object, Decl(thisTypeInFunctions2.ts, 32, 8))
this.mine
this.willDestroy
>this.mine : Symbol(mine, Decl(thisTypeInFunctions2.ts, 37, 6))
>this : Symbol(__object, Decl(thisTypeInFunctions2.ts, 32, 8))
>mine : Symbol(mine, Decl(thisTypeInFunctions2.ts, 37, 6))
}
});
@ -109,17 +119,20 @@ simple({
>simple : Symbol(simple, Decl(thisTypeInFunctions2.ts, 17, 57))
foo(n) {
>foo : Symbol(foo, Decl(thisTypeInFunctions2.ts, 46, 8))
>n : Symbol(n, Decl(thisTypeInFunctions2.ts, 47, 8))
>foo : Symbol(foo, Decl(thisTypeInFunctions2.ts, 45, 8))
>n : Symbol(n, Decl(thisTypeInFunctions2.ts, 46, 8))
return n.length + this.bar();
>n.length : Symbol(String.length, Decl(lib.d.ts, --, --))
>n : Symbol(n, Decl(thisTypeInFunctions2.ts, 47, 8))
>n : Symbol(n, Decl(thisTypeInFunctions2.ts, 46, 8))
>length : Symbol(String.length, Decl(lib.d.ts, --, --))
>this.bar : Symbol(bar, Decl(thisTypeInFunctions2.ts, 48, 6))
>this : Symbol(__object, Decl(thisTypeInFunctions2.ts, 45, 7))
>bar : Symbol(bar, Decl(thisTypeInFunctions2.ts, 48, 6))
},
bar() {
>bar : Symbol(bar, Decl(thisTypeInFunctions2.ts, 49, 6))
>bar : Symbol(bar, Decl(thisTypeInFunctions2.ts, 48, 6))
return 14;
}

View File

@ -92,26 +92,22 @@ extend1({
}
});
extend2({
>extend2({ init() { this // this: any because the contextual signature of init doesn't specify this' type this.mine this.willDestroy }, mine: 13, foo() { this // this: any because of the string indexer this.mine this.willDestroy }}) : void
>extend2({ init() { this // this: containing object literal type this.mine //this.willDestroy }, mine: 13, foo() { this // this: containing object literal type this.mine }}) : void
>extend2 : (args: IndexedWithoutThis) => void
>{ init() { this // this: any because the contextual signature of init doesn't specify this' type this.mine this.willDestroy }, mine: 13, foo() { this // this: any because of the string indexer this.mine this.willDestroy }} : { init(): void; mine: number; foo(): void; }
>{ init() { this // this: containing object literal type this.mine //this.willDestroy }, mine: 13, foo() { this // this: containing object literal type this.mine }} : { init(): void; mine: number; foo(): void; }
init() {
>init : () => void
this // this: any because the contextual signature of init doesn't specify this' type
>this : any
this // this: containing object literal type
>this : { init(): void; mine: number; foo(): void; }
this.mine
>this.mine : any
>this : any
>mine : any
this.willDestroy
>this.willDestroy : any
>this : any
>willDestroy : any
>this.mine : number
>this : { init(): void; mine: number; foo(): void; }
>mine : number
//this.willDestroy
},
mine: 13,
>mine : number
@ -120,39 +116,34 @@ extend2({
foo() {
>foo : () => void
this // this: any because of the string indexer
>this : any
this // this: containing object literal type
>this : { init(): void; mine: number; foo(): void; }
this.mine
>this.mine : any
>this : any
>mine : any
this.willDestroy
>this.willDestroy : any
>this : any
>willDestroy : any
>this.mine : number
>this : { init(): void; mine: number; foo(): void; }
>mine : number
}
});
simple({
>simple({ foo(n) { return n.length + this.bar(); }, bar() { return 14; }}) : void
>simple : (arg: SimpleInterface) => void
>{ foo(n) { return n.length + this.bar(); }, bar() { return 14; }} : { foo(n: string): any; bar(): number; }
>{ foo(n) { return n.length + this.bar(); }, bar() { return 14; }} : { foo(n: string): number; bar(): number; }
foo(n) {
>foo : (n: string) => any
>foo : (n: string) => number
>n : string
return n.length + this.bar();
>n.length + this.bar() : any
>n.length + this.bar() : number
>n.length : number
>n : string
>length : number
>this.bar() : any
>this.bar : any
>this : any
>bar : any
>this.bar() : number
>this.bar : () => number
>this : { foo(n: string): number; bar(): number; }
>bar : () => number
},
bar() {

View File

@ -9,11 +9,22 @@ let o = {
>m : Symbol(m, Decl(thisTypeInObjectLiterals.ts, 1, 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(__object, Decl(thisTypeInObjectLiterals.ts, 0, 7))
>d : Symbol(d, Decl(thisTypeInObjectLiterals.ts, 0, 9))
>length : Symbol(String.length, Decl(lib.d.ts, --, --))
},
f: function() {
>f : Symbol(f, Decl(thisTypeInObjectLiterals.ts, 4, 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(__object, Decl(thisTypeInObjectLiterals.ts, 0, 7))
>d : Symbol(d, Decl(thisTypeInObjectLiterals.ts, 0, 9))
>length : Symbol(String.length, Decl(lib.d.ts, --, --))
}
}
@ -27,12 +38,22 @@ let mutuallyRecursive = {
>start : Symbol(start, Decl(thisTypeInObjectLiterals.ts, 11, 11))
return this.passthrough(this.a);
>this.passthrough : Symbol(passthrough, Decl(thisTypeInObjectLiterals.ts, 14, 6))
>this : Symbol(__object, Decl(thisTypeInObjectLiterals.ts, 10, 23))
>passthrough : Symbol(passthrough, Decl(thisTypeInObjectLiterals.ts, 14, 6))
>this.a : Symbol(a, Decl(thisTypeInObjectLiterals.ts, 10, 25))
>this : Symbol(__object, Decl(thisTypeInObjectLiterals.ts, 10, 23))
>a : Symbol(a, Decl(thisTypeInObjectLiterals.ts, 10, 25))
},
passthrough(n: number) {
>passthrough : Symbol(passthrough, Decl(thisTypeInObjectLiterals.ts, 14, 6))
>n : Symbol(n, Decl(thisTypeInObjectLiterals.ts, 15, 16))
return this.sub1(n);
>this.sub1 : Symbol(sub1, Decl(thisTypeInObjectLiterals.ts, 17, 6))
>this : Symbol(__object, Decl(thisTypeInObjectLiterals.ts, 10, 23))
>sub1 : Symbol(sub1, Decl(thisTypeInObjectLiterals.ts, 17, 6))
>n : Symbol(n, Decl(thisTypeInObjectLiterals.ts, 15, 16))
},
@ -44,6 +65,9 @@ let mutuallyRecursive = {
>n : Symbol(n, Decl(thisTypeInObjectLiterals.ts, 18, 9))
return this.passthrough(n - 1);
>this.passthrough : Symbol(passthrough, Decl(thisTypeInObjectLiterals.ts, 14, 6))
>this : Symbol(__object, Decl(thisTypeInObjectLiterals.ts, 10, 23))
>passthrough : Symbol(passthrough, Decl(thisTypeInObjectLiterals.ts, 14, 6))
>n : Symbol(n, Decl(thisTypeInObjectLiterals.ts, 18, 9))
}
return n;

View File

@ -1,66 +1,66 @@
=== tests/cases/conformance/types/thisType/thisTypeInObjectLiterals.ts ===
let o = {
>o : { d: string; m(): any; f: () => any; }
>{ d: "bar", m() { return this.d.length; }, f: function() { return this.d.length; }} : { d: string; m(): any; f: () => any; }
>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; }
d: "bar",
>d : string
>"bar" : "bar"
m() {
>m : () => any
>m : () => number
return this.d.length;
>this.d.length : any
>this.d : any
>this : any
>d : any
>length : any
>this.d.length : number
>this.d : string
>this : { d: string; m(): number; f: () => number; }
>d : string
>length : number
},
f: function() {
>f : () => any
>function() { return this.d.length; } : () => any
>f : () => number
>function() { return this.d.length; } : () => number
return this.d.length;
>this.d.length : any
>this.d : any
>this : any
>d : any
>length : any
>this.d.length : number
>this.d : string
>this : { d: string; m(): number; f: () => number; }
>d : string
>length : number
}
}
let mutuallyRecursive = {
>mutuallyRecursive : { a: number; start(): any; passthrough(n: number): any; sub1(n: number): number; }
>{ a: 100, start() { return this.passthrough(this.a); }, passthrough(n: number) { return this.sub1(n); }, sub1(n: number): number { if (n > 0) { return this.passthrough(n - 1); } return n; }} : { a: number; start(): any; passthrough(n: number): any; sub1(n: number): number; }
>mutuallyRecursive : { a: number; start(): number; passthrough(n: number): number; sub1(n: number): number; }
>{ a: 100, start() { return this.passthrough(this.a); }, passthrough(n: number) { return this.sub1(n); }, sub1(n: number): number { if (n > 0) { return this.passthrough(n - 1); } return n; }} : { a: number; start(): number; passthrough(n: number): number; sub1(n: number): number; }
a: 100,
>a : number
>100 : 100
start() {
>start : () => any
>start : () => number
return this.passthrough(this.a);
>this.passthrough(this.a) : any
>this.passthrough : any
>this : any
>passthrough : any
>this.a : any
>this : any
>a : any
>this.passthrough(this.a) : number
>this.passthrough : (n: number) => number
>this : { a: number; start(): number; passthrough(n: number): number; sub1(n: number): number; }
>passthrough : (n: number) => number
>this.a : number
>this : { a: number; start(): number; passthrough(n: number): number; sub1(n: number): number; }
>a : number
},
passthrough(n: number) {
>passthrough : (n: number) => any
>passthrough : (n: number) => number
>n : number
return this.sub1(n);
>this.sub1(n) : any
>this.sub1 : any
>this : any
>sub1 : any
>this.sub1(n) : number
>this.sub1 : (n: number) => number
>this : { a: number; start(): number; passthrough(n: number): number; sub1(n: number): number; }
>sub1 : (n: number) => number
>n : number
},
@ -74,10 +74,10 @@ let mutuallyRecursive = {
>0 : 0
return this.passthrough(n - 1);
>this.passthrough(n - 1) : any
>this.passthrough : any
>this : any
>passthrough : any
>this.passthrough(n - 1) : number
>this.passthrough : (n: number) => number
>this : { a: number; start(): number; passthrough(n: number): number; sub1(n: number): number; }
>passthrough : (n: number) => number
>n - 1 : number
>n : number
>1 : 1
@ -88,10 +88,10 @@ let mutuallyRecursive = {
}
var i: number = mutuallyRecursive.start();
>i : number
>mutuallyRecursive.start() : any
>mutuallyRecursive.start : () => any
>mutuallyRecursive : { a: number; start(): any; passthrough(n: number): any; sub1(n: number): number; }
>start : () => any
>mutuallyRecursive.start() : number
>mutuallyRecursive.start : () => number
>mutuallyRecursive : { a: number; start(): number; passthrough(n: number): number; sub1(n: number): number; }
>start : () => number
interface I {
>I : I
@ -113,5 +113,5 @@ interface I {
var impl: I = mutuallyRecursive;
>impl : I
>I : I
>mutuallyRecursive : { a: number; start(): any; passthrough(n: number): any; sub1(n: number): number; }
>mutuallyRecursive : { a: number; start(): number; passthrough(n: number): number; sub1(n: number): number; }

View File

@ -89,6 +89,7 @@ var aa = {
>biz : Symbol(biz, Decl(throwInEnclosingStatements.ts, 41, 10))
throw this;
>this : Symbol(__object, Decl(throwInEnclosingStatements.ts, 40, 8))
}
}

View File

@ -104,7 +104,7 @@ var aa = {
>biz : () => void
throw this;
>this : any
>this : { id: number; biz(): void; }
}
}

View File

@ -395,10 +395,16 @@ 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(__object, 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(__object, Decl(underscoreTest1_underscoreTests.ts, 96, 16))
>label : Symbol(label, Decl(underscoreTest1_underscoreTests.ts, 96, 18))
};
_.bindAll(buttonView);

View File

@ -827,9 +827,9 @@ var buttonView = {
>alert : (x: string) => void
>'clicked: ' + this.label : string
>'clicked: ' : "clicked: "
>this.label : any
>this : any
>label : any
>this.label : string
>this : { label: string; onClick: () => void; onHover: () => void; }
>label : string
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 : any
>this : any
>label : any
>this.label : string
>this : { label: string; onClick: () => void; onHover: () => void; }
>label : string
};
_.bindAll(buttonView);