mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-17 21:06:50 -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
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
// 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,
|
||||
// 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 ‘if’ statement,
|
||||
// the type of a variable or parameter is narrowed by any type guard in the ‘if’ 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") {
|
||||
|
||||
@@ -23,6 +23,13 @@ module ts {
|
||||
function test(input: string, testSettings: TranspileTestSettings): void {
|
||||
|
||||
let transpileOptions: TranspileOptions = testSettings.options || {};
|
||||
if (!transpileOptions.compilerOptions) {
|
||||
transpileOptions.compilerOptions = {};
|
||||
}
|
||||
if(transpileOptions.compilerOptions.newLine === undefined) {
|
||||
// use \r\n as default new line
|
||||
transpileOptions.compilerOptions.newLine = ts.NewLineKind.CarriageReturnLineFeed;
|
||||
}
|
||||
|
||||
let canUseOldTranspile = !transpileOptions.renamedDependencies;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user