From ac8ae27139462c90a75ba89624589e55bb372120 Mon Sep 17 00:00:00 2001 From: Yui T Date: Thu, 16 Apr 2015 20:09:03 -0700 Subject: [PATCH] Address code review --- .../reference/typeGuardsOnClassProperty.errors.txt | 8 ++++---- tests/baselines/reference/typeGuardsOnClassProperty.js | 6 +++--- .../expressions/typeGuards/typeGuardsOnClassProperty.ts | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/baselines/reference/typeGuardsOnClassProperty.errors.txt b/tests/baselines/reference/typeGuardsOnClassProperty.errors.txt index 7d56c9a2049..4e6a8b83ae3 100644 --- a/tests/baselines/reference/typeGuardsOnClassProperty.errors.txt +++ b/tests/baselines/reference/typeGuardsOnClassProperty.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/expressions/typeGuards/typeGuardsOnClassProperty.ts(14,71): error TS2339: Property 'join' does not exist on type 'string | string[]'. +tests/cases/conformance/expressions/typeGuards/typeGuardsOnClassProperty.ts(14,70): error TS2339: Property 'join' does not exist on type 'string | string[]'. tests/cases/conformance/expressions/typeGuards/typeGuardsOnClassProperty.ts(26,44): error TS2339: Property 'toLowerCase' does not exist on type 'string | number'. @@ -7,7 +7,7 @@ tests/cases/conformance/expressions/typeGuards/typeGuardsOnClassProperty.ts(26,4 // have no effect on members of objects such as properties. // Note that the class's property must be copied to a local variable for - // the type guard to have an affect + // the type guard to have an effect class D { data: string | string[]; getData() { @@ -16,8 +16,8 @@ tests/cases/conformance/expressions/typeGuards/typeGuardsOnClassProperty.ts(26,4 } getData1() { - return typeof this.data === "string" ? this.data : this. data.join(" "); - ~~~~ + return typeof this.data === "string" ? this.data : this.data.join(" "); + ~~~~ !!! error TS2339: Property 'join' does not exist on type 'string | string[]'. } } diff --git a/tests/baselines/reference/typeGuardsOnClassProperty.js b/tests/baselines/reference/typeGuardsOnClassProperty.js index 5edecd36b86..de4fcb50638 100644 --- a/tests/baselines/reference/typeGuardsOnClassProperty.js +++ b/tests/baselines/reference/typeGuardsOnClassProperty.js @@ -3,7 +3,7 @@ // have no effect on members of objects such as properties. // Note that the class's property must be copied to a local variable for -// the type guard to have an affect +// the type guard to have an effect class D { data: string | string[]; getData() { @@ -12,7 +12,7 @@ class D { } getData1() { - return typeof this.data === "string" ? this.data : this. data.join(" "); + return typeof this.data === "string" ? this.data : this.data.join(" "); } } @@ -32,7 +32,7 @@ if (typeof prop1 === "string" && prop1.toLocaleLowerCase()) { } // Note that type guards affect types of variables and parameters only and // have no effect on members of objects such as properties. // Note that the class's property must be copied to a local variable for -// the type guard to have an affect +// the type guard to have an effect var D = (function () { function D() { } diff --git a/tests/cases/conformance/expressions/typeGuards/typeGuardsOnClassProperty.ts b/tests/cases/conformance/expressions/typeGuards/typeGuardsOnClassProperty.ts index 20a0bf8242a..2c26b10c6a1 100644 --- a/tests/cases/conformance/expressions/typeGuards/typeGuardsOnClassProperty.ts +++ b/tests/cases/conformance/expressions/typeGuards/typeGuardsOnClassProperty.ts @@ -2,7 +2,7 @@ // have no effect on members of objects such as properties. // Note that the class's property must be copied to a local variable for -// the type guard to have an affect +// the type guard to have an effect class D { data: string | string[]; getData() { @@ -11,7 +11,7 @@ class D { } getData1() { - return typeof this.data === "string" ? this.data : this. data.join(" "); + return typeof this.data === "string" ? this.data : this.data.join(" "); } }