Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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' || | |
|
Siggi Cherem (dart-lang)
2017/01/05 23:23:31
let's add a comment that this is for unit tests th
Emily Fortuna
2017/01/06 00:19:25
Done.
| |
| 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 Loading... | |
| 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 } |
| OLD | NEW |