| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 analyzer.src.context.source; | 5 library analyzer.src.context.source; |
| 6 | 6 |
| 7 import 'package:analyzer/file_system/file_system.dart'; | 7 import 'package:analyzer/file_system/file_system.dart'; |
| 8 import 'package:analyzer/file_system/physical_file_system.dart'; | 8 import 'package:analyzer/file_system/physical_file_system.dart'; |
| 9 import 'package:analyzer/source/package_map_resolver.dart'; | 9 import 'package:analyzer/source/package_map_resolver.dart'; |
| 10 import 'package:analyzer/src/generated/engine.dart'; | 10 import 'package:analyzer/src/generated/engine.dart'; |
| (...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 279 * @throws AnalysisException if either the contained URI is invalid or if it | 279 * @throws AnalysisException if either the contained URI is invalid or if it |
| 280 * cannot be resolved against the source object's URI | 280 * cannot be resolved against the source object's URI |
| 281 */ | 281 */ |
| 282 Source _internalResolveUri(Source containingSource, Uri containedUri) { | 282 Source _internalResolveUri(Source containingSource, Uri containedUri) { |
| 283 if (!containedUri.isAbsolute) { | 283 if (!containedUri.isAbsolute) { |
| 284 if (containingSource == null) { | 284 if (containingSource == null) { |
| 285 throw new AnalysisException( | 285 throw new AnalysisException( |
| 286 "Cannot resolve a relative URI without a containing source: " | 286 "Cannot resolve a relative URI without a containing source: " |
| 287 "$containedUri"); | 287 "$containedUri"); |
| 288 } | 288 } |
| 289 containedUri = containingSource.resolveRelativeUri(containedUri); | 289 containedUri = utils.resolveRelativeUri(containingSource.uri, containedUri
); |
| 290 } | 290 } |
| 291 | 291 |
| 292 Uri actualUri = containedUri; | 292 Uri actualUri = containedUri; |
| 293 | 293 |
| 294 // Check .packages and update target and actual URIs as appropriate. | 294 // Check .packages and update target and actual URIs as appropriate. |
| 295 if (_packages != null && containedUri.scheme == 'package') { | 295 if (_packages != null && containedUri.scheme == 'package') { |
| 296 Uri packageUri = null; | 296 Uri packageUri = null; |
| 297 try { | 297 try { |
| 298 packageUri = | 298 packageUri = |
| 299 _packages.resolve(containedUri, notFound: (Uri packageUri) => null); | 299 _packages.resolve(containedUri, notFound: (Uri packageUri) => null); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 313 for (UriResolver resolver in resolvers) { | 313 for (UriResolver resolver in resolvers) { |
| 314 Source result = resolver.resolveAbsolute(containedUri, actualUri); | 314 Source result = resolver.resolveAbsolute(containedUri, actualUri); |
| 315 if (result != null) { | 315 if (result != null) { |
| 316 return result; | 316 return result; |
| 317 } | 317 } |
| 318 } | 318 } |
| 319 | 319 |
| 320 return null; | 320 return null; |
| 321 } | 321 } |
| 322 } | 322 } |
| OLD | NEW |