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 'package:package_config/packages.dart'; | 9 import 'package:package_config/packages.dart'; |
10 import 'package:package_config/packages_file.dart' as pkgs; | 10 import 'package:package_config/packages_file.dart' as pkgs; |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 } | 132 } |
133 | 133 |
134 Future<Script> _synthesizeScript(Uri readableUri) { | 134 Future<Script> _synthesizeScript(Uri readableUri) { |
135 return new Future.value(new Script.synthetic(readableUri)); | 135 return new Future.value(new Script.synthetic(readableUri)); |
136 } | 136 } |
137 | 137 |
138 Future<Binary> readBinary(Uri resourceUri, [Spannable node]) { | 138 Future<Binary> readBinary(Uri resourceUri, [Spannable node]) { |
139 if (!resourceUri.isAbsolute) { | 139 if (!resourceUri.isAbsolute) { |
140 if (node == null) node = NO_LOCATION_SPANNABLE; | 140 if (node == null) node = NO_LOCATION_SPANNABLE; |
141 reporter.internalError( | 141 reporter.internalError( |
142 node, 'Relative uri $resourceUri provided to readScript(Uri).'); | 142 node, 'Relative uri $resourceUri provided to readBinary(Uri).'); |
143 } | 143 } |
144 | 144 |
145 // We need to store the current element since we are reporting read errors | 145 // We need to store the current element since we are reporting read errors |
146 // asynchronously and therefore need to restore the current element for | 146 // asynchronously and therefore need to restore the current element for |
147 // [node] to be valid. | 147 // [node] to be valid. |
148 elements.Element element = currentElement; | 148 elements.Element element = currentElement; |
149 | 149 |
150 return new Future.sync( | 150 return new Future.sync( |
151 () => callUserProvider(resourceUri, api.InputKind.binary)) | 151 () => callUserProvider(resourceUri, api.InputKind.binary)) |
152 .catchError((error) { | 152 .catchError((error) { |
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
418 } | 418 } |
419 } | 419 } |
420 | 420 |
421 /// For every 'dart:' library, a corresponding environment variable is set | 421 /// For every 'dart:' library, a corresponding environment variable is set |
422 /// to "true". The environment variable's name is the concatenation of | 422 /// to "true". The environment variable's name is the concatenation of |
423 /// this prefix and the name (without the 'dart:'. | 423 /// this prefix and the name (without the 'dart:'. |
424 /// | 424 /// |
425 /// For example 'dart:html' has the environment variable 'dart.library.html' set | 425 /// For example 'dart:html' has the environment variable 'dart.library.html' set |
426 /// to "true". | 426 /// to "true". |
427 const String _dartLibraryEnvironmentPrefix = 'dart.library.'; | 427 const String _dartLibraryEnvironmentPrefix = 'dart.library.'; |
OLD | NEW |