Properly set exit code for process.

Supercedes #246.
Includes provisions for buggy behavior of WScript.Quit.
This commit is contained in:
Anders Hejlsberg 2014-07-25 11:01:09 -07:00
parent 2843b82f08
commit 299f1c3390
2 changed files with 6 additions and 2 deletions

View file

@ -125,7 +125,11 @@ var sys: System = (function () {
return 0;
},
exit(exitCode?: number): void {
WScript.Quit(exitCode);
try {
WScript.Quit(exitCode);
}
catch (e) {
}
}
};
}

View file

@ -227,4 +227,4 @@ module ts {
}
}
ts.executeCommandLine(sys.args);
sys.exit(ts.executeCommandLine(sys.args));