Perform an explicit return just in case sys.exit fails.
This commit is contained in:
parent
81c4b0b900
commit
a24b175586
1 changed files with 7 additions and 6 deletions
|
@ -197,18 +197,18 @@ module ts {
|
|||
// setting up localization, report them and quit.
|
||||
if (commandLine.errors.length > 0) {
|
||||
reportDiagnostics(commandLine.errors);
|
||||
sys.exit(1);
|
||||
return sys.exit(1);
|
||||
}
|
||||
|
||||
if (commandLine.options.version) {
|
||||
reportDiagnostic(createCompilerDiagnostic(Diagnostics.Version_0, version));
|
||||
sys.exit(0);
|
||||
return sys.exit(0);
|
||||
}
|
||||
|
||||
if (commandLine.options.help || commandLine.filenames.length === 0) {
|
||||
printVersion();
|
||||
printHelp();
|
||||
sys.exit(0);
|
||||
return sys.exit(0);
|
||||
}
|
||||
|
||||
var defaultCompilerHost = createCompilerHost(commandLine.options);
|
||||
|
@ -216,13 +216,14 @@ module ts {
|
|||
if (commandLine.options.watch) {
|
||||
if (!sys.watchFile) {
|
||||
reportDiagnostic(createCompilerDiagnostic(Diagnostics.The_current_host_does_not_support_the_0_option, "--watch"));
|
||||
sys.exit(1);
|
||||
return sys.exit(1);
|
||||
}
|
||||
|
||||
watchProgram(commandLine, defaultCompilerHost);
|
||||
}
|
||||
else {
|
||||
sys.exit(compile(commandLine, defaultCompilerHost).errors.length > 0 ? 1 : 0);
|
||||
var result = compile(commandLine, defaultCompilerHost).errors.length > 0 ? 1 : 0;
|
||||
return sys.exit(result);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue