OLD | NEW |
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 library leg_apiimpl; | 5 library leg_apiimpl; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 | 8 |
9 import '../compiler.dart' as api; | 9 import '../compiler.dart' as api; |
10 import 'dart2jslib.dart' as leg; | 10 import 'dart2jslib.dart' as leg; |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 if (!libraryRoot.path.endsWith("/")) { | 99 if (!libraryRoot.path.endsWith("/")) { |
100 throw new ArgumentError("[libraryRoot] must end with a /."); | 100 throw new ArgumentError("[libraryRoot] must end with a /."); |
101 } | 101 } |
102 if (packageRoot == null) { | 102 if (packageRoot == null) { |
103 throw new ArgumentError("[packageRoot] is null."); | 103 throw new ArgumentError("[packageRoot] is null."); |
104 } | 104 } |
105 if (!packageRoot.path.endsWith("/")) { | 105 if (!packageRoot.path.endsWith("/")) { |
106 throw new ArgumentError("[packageRoot] must end with a /."); | 106 throw new ArgumentError("[packageRoot] must end with a /."); |
107 } | 107 } |
108 if (!analyzeOnly) { | 108 if (!analyzeOnly) { |
109 if (enableAsyncAwait) { | 109 if (enableAsyncAwait && emitJavaScript) { |
110 throw new ArgumentError( | 110 throw new ArgumentError( |
111 "--enable-async is currently only supported with --analyze-only"); | 111 "--enable-async is currently only supported with --analyze-only"); |
112 } | 112 } |
113 if (allowNativeExtensions) { | 113 if (allowNativeExtensions) { |
114 throw new ArgumentError( | 114 throw new ArgumentError( |
115 "--allow-native-extensions is only supported in combination with " | 115 "--allow-native-extensions is only supported in combination with " |
116 "--analyze-only"); | 116 "--analyze-only"); |
117 } | 117 } |
118 } | 118 } |
119 } | 119 } |
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
405 print('$message: ${tryToString(exception)}'); | 405 print('$message: ${tryToString(exception)}'); |
406 print(tryToString(stackTrace)); | 406 print(tryToString(stackTrace)); |
407 } | 407 } |
408 | 408 |
409 fromEnvironment(String name) => environment[name]; | 409 fromEnvironment(String name) => environment[name]; |
410 | 410 |
411 LibraryInfo lookupLibraryInfo(String libraryName) { | 411 LibraryInfo lookupLibraryInfo(String libraryName) { |
412 return library_info.LIBRARIES[libraryName]; | 412 return library_info.LIBRARIES[libraryName]; |
413 } | 413 } |
414 } | 414 } |
OLD | NEW |