From 9531d929c703dade551c2d0497574b9e8b2f1dff Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Tue, 17 Nov 2015 14:34:02 -0800 Subject: [PATCH] update test with pr feedback --- tests/baselines/reference/typeGuardInClass.js | 8 ++++---- tests/baselines/reference/typeGuardInClass.symbols | 6 ++++-- tests/baselines/reference/typeGuardInClass.types | 10 ++++++---- .../expressions/typeGuards/typeGuardInClass.ts | 4 ++-- 4 files changed, 16 insertions(+), 12 deletions(-) diff --git a/tests/baselines/reference/typeGuardInClass.js b/tests/baselines/reference/typeGuardInClass.js index 44bda9f4cb..0ce25a7c11 100644 --- a/tests/baselines/reference/typeGuardInClass.js +++ b/tests/baselines/reference/typeGuardInClass.js @@ -4,14 +4,14 @@ let x: string | number; if (typeof x === "string") { let n = class { constructor() { - x; // Should be "string" + let y: string = x; } } } else { let m = class { constructor() { - x; // Should be "number" + let y: number = x; } } } @@ -22,7 +22,7 @@ var x; if (typeof x === "string") { var n = (function () { function class_1() { - x; // Should be "string" + var y = x; } return class_1; })(); @@ -30,7 +30,7 @@ if (typeof x === "string") { else { var m = (function () { function class_2() { - x; // Should be "number" + var y = x; } return class_2; })(); diff --git a/tests/baselines/reference/typeGuardInClass.symbols b/tests/baselines/reference/typeGuardInClass.symbols index 66de165185..cc0e745e4d 100644 --- a/tests/baselines/reference/typeGuardInClass.symbols +++ b/tests/baselines/reference/typeGuardInClass.symbols @@ -9,7 +9,8 @@ if (typeof x === "string") { >n : Symbol(n, Decl(typeGuardInClass.ts, 3, 7)) constructor() { - x; // Should be "string" + let y: string = x; +>y : Symbol(y, Decl(typeGuardInClass.ts, 5, 15)) >x : Symbol(x, Decl(typeGuardInClass.ts, 0, 3)) } } @@ -19,7 +20,8 @@ else { >m : Symbol(m, Decl(typeGuardInClass.ts, 10, 7)) constructor() { - x; // Should be "number" + let y: number = x; +>y : Symbol(y, Decl(typeGuardInClass.ts, 12, 15)) >x : Symbol(x, Decl(typeGuardInClass.ts, 0, 3)) } } diff --git a/tests/baselines/reference/typeGuardInClass.types b/tests/baselines/reference/typeGuardInClass.types index 8552b58508..93fe9f28c5 100644 --- a/tests/baselines/reference/typeGuardInClass.types +++ b/tests/baselines/reference/typeGuardInClass.types @@ -10,10 +10,11 @@ if (typeof x === "string") { let n = class { >n : typeof (Anonymous class) ->class { constructor() { x; // Should be "string" } } : typeof (Anonymous class) +>class { constructor() { let y: string = x; } } : typeof (Anonymous class) constructor() { - x; // Should be "string" + let y: string = x; +>y : string >x : string } } @@ -21,10 +22,11 @@ if (typeof x === "string") { else { let m = class { >m : typeof (Anonymous class) ->class { constructor() { x; // Should be "number" } } : typeof (Anonymous class) +>class { constructor() { let y: number = x; } } : typeof (Anonymous class) constructor() { - x; // Should be "number" + let y: number = x; +>y : number >x : number } } diff --git a/tests/cases/conformance/expressions/typeGuards/typeGuardInClass.ts b/tests/cases/conformance/expressions/typeGuards/typeGuardInClass.ts index f88088744f..aa394aaa75 100644 --- a/tests/cases/conformance/expressions/typeGuards/typeGuardInClass.ts +++ b/tests/cases/conformance/expressions/typeGuards/typeGuardInClass.ts @@ -3,14 +3,14 @@ let x: string | number; if (typeof x === "string") { let n = class { constructor() { - x; // Should be "string" + let y: string = x; } } } else { let m = class { constructor() { - x; // Should be "number" + let y: number = x; } } }