File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -197,32 +197,33 @@ module ts {
197197 // setting up localization, report them and quit.
198198 if ( commandLine . errors . length > 0 ) {
199199 reportDiagnostics ( commandLine . errors ) ;
200- sys . exit ( 1 ) ;
200+ return sys . exit ( 1 ) ;
201201 }
202202
203203 if ( commandLine . options . version ) {
204204 reportDiagnostic ( createCompilerDiagnostic ( Diagnostics . Version_0 , version ) ) ;
205- sys . exit ( 0 ) ;
205+ return sys . exit ( 0 ) ;
206206 }
207207
208208 if ( commandLine . options . help || commandLine . filenames . length === 0 ) {
209209 printVersion ( ) ;
210210 printHelp ( ) ;
211- sys . exit ( 0 ) ;
211+ return sys . exit ( 0 ) ;
212212 }
213213
214214 var defaultCompilerHost = createCompilerHost ( commandLine . options ) ;
215-
215+
216216 if ( commandLine . options . watch ) {
217217 if ( ! sys . watchFile ) {
218218 reportDiagnostic ( createCompilerDiagnostic ( Diagnostics . The_current_host_does_not_support_the_0_option , "--watch" ) ) ;
219- sys . exit ( 1 ) ;
219+ return sys . exit ( 1 ) ;
220220 }
221221
222222 watchProgram ( commandLine , defaultCompilerHost ) ;
223223 }
224224 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 ) ;
226227 }
227228 }
228229
You can’t perform that action at this time.
0 commit comments