| 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'; | 7 import 'dart:uri'; |
| 8 import 'dart:async'; | 8 import 'dart:async'; |
| 9 | 9 |
| 10 import '../compiler.dart' as api; | 10 import '../compiler.dart' as api; |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 if (resolvedUri.scheme == 'dart') { | 127 if (resolvedUri.scheme == 'dart') { |
| 128 return translateDartUri(importingLibrary, resolvedUri, node); | 128 return translateDartUri(importingLibrary, resolvedUri, node); |
| 129 } | 129 } |
| 130 return resolvedUri; | 130 return resolvedUri; |
| 131 } | 131 } |
| 132 | 132 |
| 133 /** | 133 /** |
| 134 * Reads the script designated by [readableUri]. | 134 * Reads the script designated by [readableUri]. |
| 135 */ | 135 */ |
| 136 leg.Script readScript(Uri readableUri, [tree.Node node]) { | 136 leg.Script readScript(Uri readableUri, [tree.Node node]) { |
| 137 if (!readableUri.isAbsolute()) { | 137 if (!readableUri.isAbsolute) { |
| 138 internalError('Relative uri $readableUri provided to readScript(Uri)', | 138 internalError('Relative uri $readableUri provided to readScript(Uri)', |
| 139 node: node); | 139 node: node); |
| 140 } | 140 } |
| 141 return fileReadingTask.measure(() { | 141 return fileReadingTask.measure(() { |
| 142 Uri resourceUri = translateUri(readableUri, node); | 142 Uri resourceUri = translateUri(readableUri, node); |
| 143 String text = ""; | 143 String text = ""; |
| 144 try { | 144 try { |
| 145 // TODO(ahe): We expect the future to be complete and call value | 145 // TODO(ahe): We expect the future to be complete and call value |
| 146 // directly. In effect, we don't support truly asynchronous API. | 146 // directly. In effect, we don't support truly asynchronous API. |
| 147 text = deprecatedFutureValue(provider(resourceUri)); | 147 text = deprecatedFutureValue(provider(resourceUri)); |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 handler(translateUri(span.uri, null), span.begin, span.end, | 257 handler(translateUri(span.uri, null), span.begin, span.end, |
| 258 message, kind); | 258 message, kind); |
| 259 } | 259 } |
| 260 } | 260 } |
| 261 | 261 |
| 262 bool get isMockCompilation { | 262 bool get isMockCompilation { |
| 263 return mockableLibraryUsed | 263 return mockableLibraryUsed |
| 264 && (options.indexOf('--allow-mock-compilation') != -1); | 264 && (options.indexOf('--allow-mock-compilation') != -1); |
| 265 } | 265 } |
| 266 } | 266 } |
| OLD | NEW |