diff --git a/tests/baselines/reference/typeGuardsOnClassProperty.errors.txt b/tests/baselines/reference/typeGuardsOnClassProperty.errors.txt index 7d56c9a204..4e6a8b83ae 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 5edecd36b8..de4fcb5063 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 20a0bf8242..2c26b10c6a 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(" "); } }