Merge pull request #4394 from Microsoft/browserifyFix

use Harness.IO instead of sys in harness
This commit is contained in:
Vladimir Matveev
2015-08-21 14:25:44 -07:00
10 changed files with 109 additions and 80 deletions

View File

@@ -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") {

View File

@@ -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))

View File

@@ -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

View File

@@ -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") {

View File

@@ -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;