From 4c93e47596996ed81fbdf6c0e2257b0f9bead17b Mon Sep 17 00:00:00 2001 From: Arnavion Date: Wed, 3 Dec 2014 12:21:46 -0800 Subject: [PATCH 1/3] Fix missing return types. Fixes #1352 --- src/lib/es6.d.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/lib/es6.d.ts b/src/lib/es6.d.ts index 0940f26cac5..5f411d67ac8 100644 --- a/src/lib/es6.d.ts +++ b/src/lib/es6.d.ts @@ -211,7 +211,7 @@ interface NumberConstructor { * Converts a string to a floating-point number. * @param string A string that contains a floating-point number. */ - parseFloat(string: string); + parseFloat(string: string): number; /** * Converts A string to an integer. @@ -438,7 +438,7 @@ interface StringConstructor { * @param template A well-formed template string call site representation. * @param substitutions A set of substitution values. */ - raw(template: TemplateStringsArray, ...substitutions: any[]); + raw(template: TemplateStringsArray, ...substitutions: any[]): string; } interface IteratorResult { @@ -472,8 +472,8 @@ declare var GeneratorFunction: GeneratorFunctionConstructor; interface Generator extends Iterator { next(value?: any): IteratorResult; - throw (exception: any); - return (value: T); + throw (exception: any): IteratorResult; + return (value: T): IteratorResult; // [Symbol.toStringTag]: string; } @@ -874,7 +874,7 @@ interface DataView { } interface DataViewConstructor { - new (buffer: ArrayBuffer, byteOffset?: number, byteLength?: number); + new (buffer: ArrayBuffer, byteOffset?: number, byteLength?: number): DataView; } declare var DataView: DataViewConstructor; From 5b9022a51c89e949d2d72253fb9cfe40f79853a8 Mon Sep 17 00:00:00 2001 From: jbondc Date: Thu, 4 Dec 2014 09:27:24 -0500 Subject: [PATCH 2/3] Fix so 'jake diff' works with PowerShell. --- Jakefile | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/Jakefile b/Jakefile index 207cfce2e7f..4ba841d2e69 100644 --- a/Jakefile +++ b/Jakefile @@ -366,7 +366,7 @@ desc("Builds the test infrastructure using the built compiler"); task("tests", ["local", run].concat(libraryTargets)); function exec(cmd, completeHandler) { - var ex = jake.createExec([cmd]); + var ex = jake.createExec([cmd], {windowsVerbatimArguments: true}); // Add listeners for output and error ex.addListener("stdout", function(output) { process.stdout.write(output); @@ -488,18 +488,25 @@ task("runtests-browser", ["tests", "browserify", builtLocalDirectory], function( exec(cmd); }, {async: true}); +function getDiffTool() { + var program = process.env['DIFF'] || null + if (!program) + throw new Error("Add the %DIFF% environment variable to the path of the program you want to use.") + + return program; +} // Baseline Diff desc("Diffs the compiler baselines using the diff tool specified by the %DIFF% environment variable"); task('diff', function () { - var cmd = "%DIFF% " + refBaseline + ' ' + localBaseline; + var cmd = '"' + getDiffTool() + '" ' + refBaseline + ' ' + localBaseline; console.log(cmd) exec(cmd); }, {async: true}); desc("Diffs the RWC baselines using the diff tool specified by the %DIFF% environment variable"); task('diff-rwc', function () { - var cmd = "%DIFF% " + refRwcBaseline + ' ' + localRwcBaseline; + var cmd = '"' + getDiffTool() + '" ' + refRwcBaseline + ' ' + localRwcBaseline; console.log(cmd) exec(cmd); }, {async: true}); From 41c8476743c0305927a097006663f6b7cb8c5126 Mon Sep 17 00:00:00 2001 From: jbondc Date: Thu, 4 Dec 2014 14:15:00 -0500 Subject: [PATCH 3/3] Code Review --- Jakefile | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Jakefile b/Jakefile index 4ba841d2e69..16330305b6a 100644 --- a/Jakefile +++ b/Jakefile @@ -489,22 +489,22 @@ task("runtests-browser", ["tests", "browserify", builtLocalDirectory], function( }, {async: true}); function getDiffTool() { - var program = process.env['DIFF'] || null - if (!program) - throw new Error("Add the %DIFF% environment variable to the path of the program you want to use.") - + var program = process.env['DIFF'] + if (!program) { + fail("Add the 'DIFF' environment variable to the path of the program you want to use.") + } return program; } // Baseline Diff -desc("Diffs the compiler baselines using the diff tool specified by the %DIFF% environment variable"); +desc("Diffs the compiler baselines using the diff tool specified by the 'DIFF' environment variable"); task('diff', function () { var cmd = '"' + getDiffTool() + '" ' + refBaseline + ' ' + localBaseline; console.log(cmd) exec(cmd); }, {async: true}); -desc("Diffs the RWC baselines using the diff tool specified by the %DIFF% environment variable"); +desc("Diffs the RWC baselines using the diff tool specified by the 'DIFF' environment variable"); task('diff-rwc', function () { var cmd = '"' + getDiffTool() + '" ' + refRwcBaseline + ' ' + localRwcBaseline; console.log(cmd)