Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(105)

Side by Side Diff: compiler/java/com/google/dart/compiler/DartCompiler.java

Issue 12045088: Issue 8051. Make extended exit codes optional. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 package com.google.dart.compiler; 5 package com.google.dart.compiler;
6 6
7 import com.google.common.base.Objects; 7 import com.google.common.base.Objects;
8 import com.google.common.collect.Maps; 8 import com.google.common.collect.Maps;
9 import com.google.common.collect.Sets; 9 import com.google.common.collect.Sets;
10 import com.google.common.collect.Sets.SetView; 10 import com.google.common.collect.Sets.SetView;
(...skipping 1050 matching lines...) Expand 10 before | Expand all | Expand 10 after
1061 return compilerMain(compilerOptions); 1061 return compilerMain(compilerOptions);
1062 } 1062 }
1063 }); 1063 });
1064 } else { 1064 } else {
1065 result = compilerMain(topCompilerOptions); 1065 result = compilerMain(topCompilerOptions);
1066 } 1066 }
1067 } catch (Throwable t) { 1067 } catch (Throwable t) {
1068 t.printStackTrace(); 1068 t.printStackTrace();
1069 crash(); 1069 crash();
1070 } 1070 }
1071 System.exit(result.code); 1071 // exit
1072 {
1073 int exitCode = result.code;
1074 if (!topCompilerOptions.extendedExitCode()) {
1075 if (exitCode == RESULT_ERRORS) {
1076 exitCode = 1;
1077 } else {
1078 exitCode = 0;
1079 }
1080 }
1081 System.exit(exitCode);
1082 }
1072 } 1083 }
1073 1084
1074 /** 1085 /**
1075 * Invoke the compiler to build single application. 1086 * Invoke the compiler to build single application.
1076 * 1087 *
1077 * @param compilerOptions parsed command line arguments 1088 * @param compilerOptions parsed command line arguments
1078 * @return the result as integer when <code>0</code> means clean; <code>1</cod e> there were 1089 * @return the result as integer when <code>0</code> means clean; <code>1</cod e> there were
1079 * warnings; <code>2</code> there were errors; <code>127</code> other problems or 1090 * warnings; <code>2</code> there were errors; <code>127</code> other problems or
1080 * exceptions. 1091 * exceptions.
1081 */ 1092 */
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after
1439 return br.readLine(); 1450 return br.readLine();
1440 } finally { 1451 } finally {
1441 br.close(); 1452 br.close();
1442 } 1453 }
1443 } 1454 }
1444 } catch (Throwable e) { 1455 } catch (Throwable e) {
1445 } 1456 }
1446 return null; 1457 return null;
1447 } 1458 }
1448 } 1459 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698