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 '../compiler.dart' as api; | 9 import '../compiler.dart' as api; |
10 import 'dart2jslib.dart' as leg; | 10 import 'dart2jslib.dart' as leg; |
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
283 Uri resolvedUri, tree.Node node) { | 283 Uri resolvedUri, tree.Node node) { |
284 LibraryInfo libraryInfo = lookupLibraryInfo(resolvedUri.path); | 284 LibraryInfo libraryInfo = lookupLibraryInfo(resolvedUri.path); |
285 String path = lookupLibraryPath(resolvedUri.path); | 285 String path = lookupLibraryPath(resolvedUri.path); |
286 if (libraryInfo != null && | 286 if (libraryInfo != null && |
287 libraryInfo.category == "Internal") { | 287 libraryInfo.category == "Internal") { |
288 bool allowInternalLibraryAccess = false; | 288 bool allowInternalLibraryAccess = false; |
289 if (importingLibrary != null) { | 289 if (importingLibrary != null) { |
290 if (importingLibrary.isPlatformLibrary || importingLibrary.isPatch) { | 290 if (importingLibrary.isPlatformLibrary || importingLibrary.isPatch) { |
291 allowInternalLibraryAccess = true; | 291 allowInternalLibraryAccess = true; |
292 } else if (importingLibrary.canonicalUri.path.contains( | 292 } else if (importingLibrary.canonicalUri.path.contains( |
293 'dart/tests/compiler/dart2js_native')) { | 293 'sdk/tests/compiler/dart2js_native')) { |
294 allowInternalLibraryAccess = true; | 294 allowInternalLibraryAccess = true; |
295 } | 295 } |
296 } | 296 } |
297 if (!allowInternalLibraryAccess) { | 297 if (!allowInternalLibraryAccess) { |
298 if (importingLibrary != null) { | 298 if (importingLibrary != null) { |
299 reportError( | 299 reportError( |
300 node, | 300 node, |
301 leg.MessageKind.INTERNAL_LIBRARY_FROM, | 301 leg.MessageKind.INTERNAL_LIBRARY_FROM, |
302 {'resolvedUri': resolvedUri, | 302 {'resolvedUri': resolvedUri, |
303 'importingUri': importingLibrary.canonicalUri}); | 303 'importingUri': importingLibrary.canonicalUri}); |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
402 print('$message: ${tryToString(exception)}'); | 402 print('$message: ${tryToString(exception)}'); |
403 print(tryToString(stackTrace)); | 403 print(tryToString(stackTrace)); |
404 } | 404 } |
405 | 405 |
406 fromEnvironment(String name) => environment[name]; | 406 fromEnvironment(String name) => environment[name]; |
407 | 407 |
408 LibraryInfo lookupLibraryInfo(String libraryName) { | 408 LibraryInfo lookupLibraryInfo(String libraryName) { |
409 return library_info.LIBRARIES[libraryName]; | 409 return library_info.LIBRARIES[libraryName]; |
410 } | 410 } |
411 } | 411 } |
OLD | NEW |