File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -197,32 +197,33 @@ module ts {
197
197
// setting up localization, report them and quit.
198
198
if ( commandLine . errors . length > 0 ) {
199
199
reportDiagnostics ( commandLine . errors ) ;
200
- sys . exit ( 1 ) ;
200
+ return sys . exit ( 1 ) ;
201
201
}
202
202
203
203
if ( commandLine . options . version ) {
204
204
reportDiagnostic ( createCompilerDiagnostic ( Diagnostics . Version_0 , version ) ) ;
205
- sys . exit ( 0 ) ;
205
+ return sys . exit ( 0 ) ;
206
206
}
207
207
208
208
if ( commandLine . options . help || commandLine . filenames . length === 0 ) {
209
209
printVersion ( ) ;
210
210
printHelp ( ) ;
211
- sys . exit ( 0 ) ;
211
+ return sys . exit ( 0 ) ;
212
212
}
213
213
214
214
var defaultCompilerHost = createCompilerHost ( commandLine . options ) ;
215
-
215
+
216
216
if ( commandLine . options . watch ) {
217
217
if ( ! sys . watchFile ) {
218
218
reportDiagnostic ( createCompilerDiagnostic ( Diagnostics . The_current_host_does_not_support_the_0_option , "--watch" ) ) ;
219
- sys . exit ( 1 ) ;
219
+ return sys . exit ( 1 ) ;
220
220
}
221
221
222
222
watchProgram ( commandLine , defaultCompilerHost ) ;
223
223
}
224
224
else {
225
- sys . exit ( compile ( commandLine , defaultCompilerHost ) . errors . length > 0 ? 1 : 0 ) ;
225
+ var result = compile ( commandLine , defaultCompilerHost ) . errors . length > 0 ? 1 : 0 ;
226
+ return sys . exit ( result ) ;
226
227
}
227
228
}
228
229
You can’t perform that action at this time.
0 commit comments