| 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:uri'; | |
| 8 import 'dart:async'; | 7 import 'dart:async'; |
| 9 | 8 |
| 10 import '../compiler.dart' as api; | 9 import '../compiler.dart' as api; |
| 11 import 'dart2jslib.dart' as leg; | 10 import 'dart2jslib.dart' as leg; |
| 12 import 'tree/tree.dart' as tree; | 11 import 'tree/tree.dart' as tree; |
| 13 import 'elements/elements.dart' as elements; | 12 import 'elements/elements.dart' as elements; |
| 14 import 'ssa/tracer.dart' as ssa; | 13 import 'ssa/tracer.dart' as ssa; |
| 15 import '../../libraries.dart'; | 14 import '../../libraries.dart'; |
| 16 import 'source_file.dart'; | 15 import 'source_file.dart'; |
| 17 | 16 |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 LibraryInfo info = LIBRARIES[dartLibraryName]; | 128 LibraryInfo info = LIBRARIES[dartLibraryName]; |
| 130 if (info == null) return null; | 129 if (info == null) return null; |
| 131 if (!info.isDart2jsLibrary) return null; | 130 if (!info.isDart2jsLibrary) return null; |
| 132 String path = info.dart2jsPatchPath; | 131 String path = info.dart2jsPatchPath; |
| 133 if (path == null) return null; | 132 if (path == null) return null; |
| 134 return "lib/$path"; | 133 return "lib/$path"; |
| 135 } | 134 } |
| 136 | 135 |
| 137 elements.LibraryElement scanBuiltinLibrary(String path) { | 136 elements.LibraryElement scanBuiltinLibrary(String path) { |
| 138 Uri uri = libraryRoot.resolve(lookupLibraryPath(path)); | 137 Uri uri = libraryRoot.resolve(lookupLibraryPath(path)); |
| 139 Uri canonicalUri = new Uri.fromComponents(scheme: "dart", path: path); | 138 Uri canonicalUri = new Uri(scheme: "dart", path: path); |
| 140 elements.LibraryElement library = | 139 elements.LibraryElement library = |
| 141 libraryLoader.loadLibrary(uri, null, canonicalUri); | 140 libraryLoader.loadLibrary(uri, null, canonicalUri); |
| 142 return library; | 141 return library; |
| 143 } | 142 } |
| 144 | 143 |
| 145 void log(message) { | 144 void log(message) { |
| 146 handler(null, null, null, message, api.Diagnostic.VERBOSE_INFO); | 145 handler(null, null, null, message, api.Diagnostic.VERBOSE_INFO); |
| 147 } | 146 } |
| 148 | 147 |
| 149 /// See [leg.Compiler.translateResolvedUri]. | 148 /// See [leg.Compiler.translateResolvedUri]. |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 282 handler(translateUri(span.uri, null), span.begin, span.end, | 281 handler(translateUri(span.uri, null), span.begin, span.end, |
| 283 message, kind); | 282 message, kind); |
| 284 } | 283 } |
| 285 } | 284 } |
| 286 | 285 |
| 287 bool get isMockCompilation { | 286 bool get isMockCompilation { |
| 288 return mockableLibraryUsed | 287 return mockableLibraryUsed |
| 289 && (options.indexOf('--allow-mock-compilation') != -1); | 288 && (options.indexOf('--allow-mock-compilation') != -1); |
| 290 } | 289 } |
| 291 } | 290 } |
| OLD | NEW |