| 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 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 251 | 251 |
| 252 Uri resolvePatchUri(String dartLibraryPath) { | 252 Uri resolvePatchUri(String dartLibraryPath) { |
| 253 String patchPath = lookupPatchPath(dartLibraryPath); | 253 String patchPath = lookupPatchPath(dartLibraryPath); |
| 254 if (patchPath == null) return null; | 254 if (patchPath == null) return null; |
| 255 return libraryRoot.resolve(patchPath); | 255 return libraryRoot.resolve(patchPath); |
| 256 } | 256 } |
| 257 | 257 |
| 258 Uri translatePackageUri(Uri uri, tree.Node node) { | 258 Uri translatePackageUri(Uri uri, tree.Node node) { |
| 259 if (packageRoot == null) { | 259 if (packageRoot == null) { |
| 260 if (node != null) { | 260 if (node != null) { |
| 261 reportErrorCode(node, | 261 reportErrorCode(node, |
| 262 leg.MessageKind.PACKAGE_ROOT_NOT_SET, | 262 leg.MessageKind.PACKAGE_ROOT_NOT_SET, |
| 263 {'uri': uri}); | 263 {'uri': uri}); |
| 264 } else { | 264 } else { |
| 265 reportDiagnostic(null, | 265 reportDiagnostic(null, |
| 266 leg.MessageKind.PACKAGE_ROOT_NOT_SET.error({'uri': uri}).toString(), | 266 leg.MessageKind.PACKAGE_ROOT_NOT_SET.error({'uri': uri}).toString(), |
| 267 api.Diagnostic.ERROR); | 267 api.Diagnostic.ERROR); |
| 268 | |
| 269 } | 268 } |
| 270 throw new leg.CompilerCancelledException("Package root not set."); | 269 throw new leg.CompilerCancelledException("Package root not set."); |
| 271 } | 270 } |
| 272 return packageRoot.resolve(uri.path); | 271 return packageRoot.resolve(uri.path); |
| 273 } | 272 } |
| 274 | 273 |
| 275 bool run(Uri uri) { | 274 bool run(Uri uri) { |
| 276 log('Allowed library categories: $allowedLibraryCategories'); | 275 log('Allowed library categories: $allowedLibraryCategories'); |
| 277 bool success = super.run(uri); | 276 bool success = super.run(uri); |
| 278 int cumulated = 0; | 277 int cumulated = 0; |
| (...skipping 21 matching lines...) Expand all Loading... |
| 300 handler(translateUri(span.uri, null), span.begin, span.end, | 299 handler(translateUri(span.uri, null), span.begin, span.end, |
| 301 message, kind); | 300 message, kind); |
| 302 } | 301 } |
| 303 } | 302 } |
| 304 | 303 |
| 305 bool get isMockCompilation { | 304 bool get isMockCompilation { |
| 306 return mockableLibraryUsed | 305 return mockableLibraryUsed |
| 307 && (options.indexOf('--allow-mock-compilation') != -1); | 306 && (options.indexOf('--allow-mock-compilation') != -1); |
| 308 } | 307 } |
| 309 } | 308 } |
| OLD | NEW |