Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(95)

Side by Side Diff: pkg/analyzer/lib/src/generated/source.dart

Issue 1224693014: Fix for URI resolution w/ file scheme set in package map. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | pkg/analyzer/test/generated/source_factory_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 // This code was auto-generated, is not intended to be edited, and is subject to 5 // This code was auto-generated, is not intended to be edited, and is subject to
6 // significant change. Please see the README file for more information. 6 // significant change. Please see the README file for more information.
7 7
8 library engine.source; 8 library engine.source;
9 9
10 import 'dart:collection'; 10 import 'dart:collection';
(...skipping 800 matching lines...) Expand 10 before | Expand all | Expand 10 after
811 if (containingSource == null) { 811 if (containingSource == null) {
812 throw new AnalysisException( 812 throw new AnalysisException(
813 "Cannot resolve a relative URI without a containing source: $contain edUri"); 813 "Cannot resolve a relative URI without a containing source: $contain edUri");
814 } 814 }
815 containedUri = containingSource.resolveRelativeUri(containedUri); 815 containedUri = containingSource.resolveRelativeUri(containedUri);
816 } 816 }
817 // Now check .packages. 817 // Now check .packages.
818 if (_packages != null && containedUri.scheme == 'package') { 818 if (_packages != null && containedUri.scheme == 'package') {
819 Uri packageUri = 819 Uri packageUri =
820 _packages.resolve(containedUri, notFound: (Uri packageUri) => null); 820 _packages.resolve(containedUri, notFound: (Uri packageUri) => null);
821 //TODO(pquitslund): package_config needs to be updated to set schemes for file URIs. 821 // Ensure scheme is set.
822 if (packageUri != null && packageUri.scheme == '') { 822 if (packageUri != null && packageUri.scheme == '') {
823 containedUri = packageUri.replace(scheme: 'file'); 823 packageUri = packageUri.replace(scheme: 'file');
824 } 824 }
825 containedUri = packageUri;
825 } 826 }
826 for (UriResolver resolver in _resolvers) { 827 for (UriResolver resolver in _resolvers) {
827 Source result = resolver.resolveAbsolute(containedUri); 828 Source result = resolver.resolveAbsolute(containedUri);
828 if (result != null) { 829 if (result != null) {
829 return result; 830 return result;
830 } 831 }
831 } 832 }
832 return null; 833 return null;
833 } 834 }
834 } 835 }
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
1067 1068
1068 /** 1069 /**
1069 * Return an absolute URI that represents the given source, or `null` if a val id URI cannot 1070 * Return an absolute URI that represents the given source, or `null` if a val id URI cannot
1070 * be computed. 1071 * be computed.
1071 * 1072 *
1072 * @param source the source to get URI for 1073 * @param source the source to get URI for
1073 * @return the absolute URI representing the given source 1074 * @return the absolute URI representing the given source
1074 */ 1075 */
1075 Uri restoreAbsolute(Source source) => null; 1076 Uri restoreAbsolute(Source source) => null;
1076 } 1077 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/test/generated/source_factory_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698