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