mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-07-07 17:26:48 -05:00
Merge pull request #4394 from Microsoft/browserifyFix
use Harness.IO instead of sys in harness
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
//// [typeGuardsInIfStatement.ts]
|
||||
// In the true branch statement of an <EFBFBD>if<EFBFBD> statement,
|
||||
// the type of a variable or parameter is narrowed by any type guard in the <EFBFBD>if<EFBFBD> condition when true,
|
||||
// In the true branch statement of an 'if' statement,
|
||||
// the type of a variable or parameter is narrowed by any type guard in the 'if' condition when true,
|
||||
// provided the true branch statement contains no assignments to the variable or parameter.
|
||||
// In the false branch statement of an <EFBFBD>if<EFBFBD> statement,
|
||||
// the type of a variable or parameter is narrowed by any type guard in the <EFBFBD>if<EFBFBD> condition when false,
|
||||
// In the false branch statement of an 'if' statement,
|
||||
// the type of a variable or parameter is narrowed by any type guard in the 'if' condition when false,
|
||||
// provided the false branch statement contains no assignments to the variable or parameter
|
||||
function foo(x: number | string) {
|
||||
if (typeof x === "string") {
|
||||
@@ -149,11 +149,11 @@ function foo12(x: number | string | boolean) {
|
||||
}
|
||||
|
||||
//// [typeGuardsInIfStatement.js]
|
||||
// In the true branch statement of an <EFBFBD>if<EFBFBD> statement,
|
||||
// the type of a variable or parameter is narrowed by any type guard in the <EFBFBD>if<EFBFBD> condition when true,
|
||||
// In the true branch statement of an 'if' statement,
|
||||
// the type of a variable or parameter is narrowed by any type guard in the 'if' condition when true,
|
||||
// provided the true branch statement contains no assignments to the variable or parameter.
|
||||
// In the false branch statement of an <EFBFBD>if<EFBFBD> statement,
|
||||
// the type of a variable or parameter is narrowed by any type guard in the <EFBFBD>if<EFBFBD> condition when false,
|
||||
// In the false branch statement of an 'if' statement,
|
||||
// the type of a variable or parameter is narrowed by any type guard in the 'if' condition when false,
|
||||
// provided the false branch statement contains no assignments to the variable or parameter
|
||||
function foo(x) {
|
||||
if (typeof x === "string") {
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
=== tests/cases/conformance/expressions/typeGuards/typeGuardsInIfStatement.ts ===
|
||||
// In the true branch statement of an <EFBFBD>if<EFBFBD> statement,
|
||||
// the type of a variable or parameter is narrowed by any type guard in the <EFBFBD>if<EFBFBD> condition when true,
|
||||
// In the true branch statement of an 'if' statement,
|
||||
// the type of a variable or parameter is narrowed by any type guard in the 'if' condition when true,
|
||||
// provided the true branch statement contains no assignments to the variable or parameter.
|
||||
// In the false branch statement of an <EFBFBD>if<EFBFBD> statement,
|
||||
// the type of a variable or parameter is narrowed by any type guard in the <EFBFBD>if<EFBFBD> condition when false,
|
||||
// In the false branch statement of an 'if' statement,
|
||||
// the type of a variable or parameter is narrowed by any type guard in the 'if' condition when false,
|
||||
// provided the false branch statement contains no assignments to the variable or parameter
|
||||
function foo(x: number | string) {
|
||||
>foo : Symbol(foo, Decl(typeGuardsInIfStatement.ts, 0, 0))
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
=== tests/cases/conformance/expressions/typeGuards/typeGuardsInIfStatement.ts ===
|
||||
// In the true branch statement of an <EFBFBD>if<EFBFBD> statement,
|
||||
// the type of a variable or parameter is narrowed by any type guard in the <EFBFBD>if<EFBFBD> condition when true,
|
||||
// In the true branch statement of an 'if' statement,
|
||||
// the type of a variable or parameter is narrowed by any type guard in the 'if' condition when true,
|
||||
// provided the true branch statement contains no assignments to the variable or parameter.
|
||||
// In the false branch statement of an <EFBFBD>if<EFBFBD> statement,
|
||||
// the type of a variable or parameter is narrowed by any type guard in the <EFBFBD>if<EFBFBD> condition when false,
|
||||
// In the false branch statement of an 'if' statement,
|
||||
// the type of a variable or parameter is narrowed by any type guard in the 'if' condition when false,
|
||||
// provided the false branch statement contains no assignments to the variable or parameter
|
||||
function foo(x: number | string) {
|
||||
>foo : (x: number | string) => number
|
||||
|
||||
Reference in New Issue
Block a user