| 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 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 */ | 157 */ |
| 158 Future<leg.Script> readScript(Uri readableUri, | 158 Future<leg.Script> readScript(Uri readableUri, |
| 159 [elements.Element element, tree.Node node]) { | 159 [elements.Element element, tree.Node node]) { |
| 160 if (!readableUri.isAbsolute) { | 160 if (!readableUri.isAbsolute) { |
| 161 internalError('Relative uri $readableUri provided to readScript(Uri)', | 161 internalError('Relative uri $readableUri provided to readScript(Uri)', |
| 162 node: node); | 162 node: node); |
| 163 } | 163 } |
| 164 | 164 |
| 165 // TODO(johnniwinther): Add [:report(..., {Element element}):] to | 165 // TODO(johnniwinther): Add [:report(..., {Element element}):] to |
| 166 // report methods in Compiler. | 166 // report methods in Compiler. |
| 167 void reportReadError(String exception) { | 167 void reportReadError(exception) { |
| 168 withCurrentElement(element, () { | 168 withCurrentElement(element, () { |
| 169 reportError(node, | 169 reportError(node, |
| 170 leg.MessageKind.READ_SCRIPT_ERROR, | 170 leg.MessageKind.READ_SCRIPT_ERROR, |
| 171 {'uri': readableUri, 'exception': exception}); | 171 {'uri': readableUri, 'exception': exception}); |
| 172 }); | 172 }); |
| 173 } | 173 } |
| 174 | 174 |
| 175 Uri resourceUri = translateUri(readableUri, node); | 175 Uri resourceUri = translateUri(readableUri, node); |
| 176 // TODO(johnniwinther): Wrap the result from [provider] in a specialized | 176 // TODO(johnniwinther): Wrap the result from [provider] in a specialized |
| 177 // [Future] to ensure that we never execute an asynchronous action without s
etting | 177 // [Future] to ensure that we never execute an asynchronous action without s
etting |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 288 handler(translateUri(span.uri, null), span.begin, span.end, | 288 handler(translateUri(span.uri, null), span.begin, span.end, |
| 289 message, kind); | 289 message, kind); |
| 290 } | 290 } |
| 291 } | 291 } |
| 292 | 292 |
| 293 bool get isMockCompilation { | 293 bool get isMockCompilation { |
| 294 return mockableLibraryUsed | 294 return mockableLibraryUsed |
| 295 && (options.indexOf('--allow-mock-compilation') != -1); | 295 && (options.indexOf('--allow-mock-compilation') != -1); |
| 296 } | 296 } |
| 297 } | 297 } |
| OLD | NEW |