Skip to content

Commit 7ae6739

Browse files
committed
Correctly handle async calls; fix formatting
1 parent 18de560 commit 7ae6739

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

Jakefile

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -313,9 +313,9 @@ function exec(cmd, completeHandler) {
313313
complete();
314314
});
315315
ex.addListener("error", function(e, status) {
316-
process.stderr.write(status);
317-
process.stderr.write(e);
318-
complete();
316+
process.stderr.write(status);
317+
process.stderr.write(e);
318+
complete();
319319
})
320320
try{
321321
ex.run();
@@ -378,9 +378,9 @@ task("runtests", ["tests", builtLocalDirectory], function() {
378378

379379
desc("Generates code coverage data via instanbul")
380380
task("generate-code-coverage", ["tests", builtLocalDirectory], function () {
381-
var cmd = 'istanbul cover node_modules/mocha/bin/_mocha -- -R min -t ' + testTimeout + ' ' + run;
382-
console.log(cmd);
383-
exec(cmd);
381+
var cmd = 'istanbul cover node_modules/mocha/bin/_mocha -- -R min -t ' + testTimeout + ' ' + run;
382+
console.log(cmd);
383+
exec(cmd);
384384
}, { async: true });
385385

386386
// Browser tests
@@ -465,7 +465,7 @@ compileFile(webhostJsPath, [webhostPath], [tscFile, webhostPath].concat(libraryT
465465

466466
desc("Builds the tsc web host");
467467
task("webhost", [webhostJsPath], function() {
468-
jake.cpR(path.join(builtLocalDirectory, "lib.d.ts"), "tests/webhost/", {silent: true});
468+
jake.cpR(path.join(builtLocalDirectory, "lib.d.ts"), "tests/webhost/", {silent: true});
469469
});
470470

471471
// Perf compiler
@@ -478,16 +478,17 @@ task("perftsc", [perftscJsPath]);
478478
// Instrumented compiler
479479
var loggedIOpath = harnessDirectory + 'loggedIO.ts';
480480
var loggedIOJsPath = builtLocalDirectory + 'loggedIO.js';
481-
file(loggedIOJsPath, [builtLocalDirectory], function() {
482-
var temp = builtLocalDirectory + 'temp';
481+
file(loggedIOJsPath, [builtLocalDirectory, loggedIOpath], function() {
482+
var temp = builtLocalDirectory + 'temp';
483483
jake.mkdirP(temp);
484484
var options = "--outdir " + temp + ' ' + loggedIOpath;
485485
var cmd = host + " " + LKGDirectory + compilerFilename + " " + options + " ";
486486
console.log(cmd + "\n");
487487
var ex = jake.createExec([cmd]);
488488
ex.addListener("cmdEnd", function() {
489-
fs.renameSync(temp + '/harness/loggedIO.js', loggedIOJsPath);
490-
jake.rmRf(temp);
489+
fs.renameSync(temp + '/harness/loggedIO.js', loggedIOJsPath);
490+
jake.rmRf(temp);
491+
complete();
491492
});
492493
ex.run();
493494
}, {async: true});
@@ -498,12 +499,11 @@ compileFile(instrumenterJsPath, [instrumenterPath], [tscFile, instrumenterPath],
498499

499500
desc("Builds an instrumented tsc.js");
500501
task('tsc-instrumented', [loggedIOJsPath, instrumenterJsPath, tscFile], function() {
501-
var cmd = host + ' ' + instrumenterJsPath + ' record iocapture ' + builtLocalDirectory + compilerFilename;
502-
console.log(cmd);
502+
var cmd = host + ' ' + instrumenterJsPath + ' record iocapture ' + builtLocalDirectory + compilerFilename;
503+
console.log(cmd);
503504
var ex = jake.createExec([cmd]);
504-
ex.addListener("error", function(e) {
505-
console.log('error running instrumenter');
506-
console.log(e);
505+
ex.addListener("cmdEnd", function() {
506+
complete();
507507
});
508-
ex.run();
509-
}, { async: true });
508+
ex.run();
509+
}, { async: true });

0 commit comments

Comments
 (0)