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

Side by Side Diff: pkg/compiler/lib/src/resolved_uri_translator.dart

Issue 2614983004: Reapply 0c78abd0900d (Closed)
Patch Set: . Created 3 years, 11 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/compiler/lib/src/ssa/builder_kernel.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) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, 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 import 'common.dart'; 5 import 'common.dart';
6 import 'elements/elements.dart' show LibraryElement; 6 import 'elements/elements.dart' show LibraryElement;
7 import 'util/emptyset.dart'; 7 import 'util/emptyset.dart';
8 8
9 /// API used by the library loader to translate internal SDK URIs into file 9 /// API used by the library loader to translate internal SDK URIs into file
10 /// system readable URIs. 10 /// system readable URIs.
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 if (location == null) { 108 if (location == null) {
109 _reporter.reportErrorMessage(spannable, MessageKind.LIBRARY_NOT_FOUND, 109 _reporter.reportErrorMessage(spannable, MessageKind.LIBRARY_NOT_FOUND,
110 {'resolvedUri': resolvedUri}); 110 {'resolvedUri': resolvedUri});
111 return null; 111 return null;
112 } 112 }
113 113
114 if (resolvedUri.path.startsWith('_')) { 114 if (resolvedUri.path.startsWith('_')) {
115 bool allowInternalLibraryAccess = importingLibrary != null && 115 bool allowInternalLibraryAccess = importingLibrary != null &&
116 (importingLibrary.isPlatformLibrary || 116 (importingLibrary.isPlatformLibrary ||
117 importingLibrary.isPatch || 117 importingLibrary.isPatch ||
118 importingLibrary.canonicalUri.scheme == 'memory' ||
118 importingLibrary.canonicalUri.path 119 importingLibrary.canonicalUri.path
119 .contains('sdk/tests/compiler/dart2js_native')); 120 .contains('sdk/tests/compiler/dart2js_native'));
120 121
121 if (!allowInternalLibraryAccess) { 122 if (!allowInternalLibraryAccess) {
122 if (importingLibrary != null) { 123 if (importingLibrary != null) {
123 _reporter.reportErrorMessage( 124 _reporter.reportErrorMessage(
124 spannable, MessageKind.INTERNAL_LIBRARY_FROM, { 125 spannable, MessageKind.INTERNAL_LIBRARY_FROM, {
125 'resolvedUri': resolvedUri, 126 'resolvedUri': resolvedUri,
126 'importingUri': importingLibrary.canonicalUri 127 'importingUri': importingLibrary.canonicalUri
127 }); 128 });
(...skipping 22 matching lines...) Expand all
150 } 151 }
151 152
152 void registerDisallowedLibraryUse(Uri uri) { 153 void registerDisallowedLibraryUse(Uri uri) {
153 disallowedLibraryUris.add(uri); 154 disallowedLibraryUris.add(uri);
154 } 155 }
155 156
156 Uri lookupLibraryUri(String libraryName) { 157 Uri lookupLibraryUri(String libraryName) {
157 return _sdkLibraries[libraryName]; 158 return _sdkLibraries[libraryName];
158 } 159 }
159 } 160 }
OLDNEW
« no previous file with comments | « no previous file | pkg/compiler/lib/src/ssa/builder_kernel.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698