OLD | NEW |
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 library deferred_load; | 5 library deferred_load; |
6 | 6 |
7 import 'constants/expressions.dart'; | 7 import 'constants/expressions.dart'; |
8 import 'constants/values.dart' show | 8 import 'constants/values.dart' show |
9 ConstantValue, | 9 ConstantValue, |
10 ConstructedConstantValue, | 10 ConstructedConstantValue, |
(...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
506 result = import.prefix.toString(); | 506 result = import.prefix.toString(); |
507 } else { | 507 } else { |
508 Link<MetadataAnnotation> metadatas = import.metadata; | 508 Link<MetadataAnnotation> metadatas = import.metadata; |
509 assert(metadatas != null); | 509 assert(metadatas != null); |
510 for (MetadataAnnotation metadata in metadatas) { | 510 for (MetadataAnnotation metadata in metadatas) { |
511 metadata.ensureResolved(compiler); | 511 metadata.ensureResolved(compiler); |
512 Element element = | 512 Element element = |
513 metadata.constant.value.getType(compiler.coreTypes).element; | 513 metadata.constant.value.getType(compiler.coreTypes).element; |
514 if (element == deferredLibraryClass) { | 514 if (element == deferredLibraryClass) { |
515 ConstructedConstantValue constant = metadata.constant.value; | 515 ConstructedConstantValue constant = metadata.constant.value; |
516 StringConstantValue s = constant.fields[0]; | 516 StringConstantValue s = constant.fields.values.single; |
517 result = s.primitiveValue.slowToString(); | 517 result = s.primitiveValue.slowToString(); |
518 break; | 518 break; |
519 } | 519 } |
520 } | 520 } |
521 } | 521 } |
522 assert(result != null); | 522 assert(result != null); |
523 importDeferName[import] = makeUnique(result, usedImportNames);; | 523 importDeferName[import] = makeUnique(result, usedImportNames);; |
524 } | 524 } |
525 | 525 |
526 int counter = 1; | 526 int counter = 1; |
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
860 _importingLibrary = importingLibrary; | 860 _importingLibrary = importingLibrary; |
861 | 861 |
862 String get importingLibraryName { | 862 String get importingLibraryName { |
863 String libraryName = _importingLibrary.getLibraryName(); | 863 String libraryName = _importingLibrary.getLibraryName(); |
864 return libraryName == "" | 864 return libraryName == "" |
865 ? "<unnamed>" | 865 ? "<unnamed>" |
866 : libraryName; | 866 : libraryName; |
867 } | 867 } |
868 | 868 |
869 } | 869 } |
OLD | NEW |