| 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 641 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 652 Import import = tag; | 652 Import import = tag; |
| 653 | 653 |
| 654 /// Give an error if the old annotation-based syntax has been used. | 654 /// Give an error if the old annotation-based syntax has been used. |
| 655 Link<MetadataAnnotation> metadataList = import.metadata; | 655 Link<MetadataAnnotation> metadataList = import.metadata; |
| 656 if (metadataList != null) { | 656 if (metadataList != null) { |
| 657 for (MetadataAnnotation metadata in metadataList) { | 657 for (MetadataAnnotation metadata in metadataList) { |
| 658 metadata.ensureResolved(compiler); | 658 metadata.ensureResolved(compiler); |
| 659 Element element = | 659 Element element = |
| 660 metadata.constant.value.getType(compiler.coreTypes).element; | 660 metadata.constant.value.getType(compiler.coreTypes).element; |
| 661 if (element == deferredLibraryClass) { | 661 if (element == deferredLibraryClass) { |
| 662 compiler.reportFatalError( | 662 compiler.reportError( |
| 663 import, MessageKind.DEFERRED_OLD_SYNTAX); | 663 import, MessageKind.DEFERRED_OLD_SYNTAX); |
| 664 } | 664 } |
| 665 } | 665 } |
| 666 } | 666 } |
| 667 | 667 |
| 668 String prefix = (import.prefix != null) | 668 String prefix = (import.prefix != null) |
| 669 ? import.prefix.toString() | 669 ? import.prefix.toString() |
| 670 : null; | 670 : null; |
| 671 // The last import we saw with the same prefix. | 671 // The last import we saw with the same prefix. |
| 672 Import previousDeferredImport = prefixDeferredImport[prefix]; | 672 Import previousDeferredImport = prefixDeferredImport[prefix]; |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 758 Element maybePrefix = elements[identifier]; | 758 Element maybePrefix = elements[identifier]; |
| 759 if (maybePrefix != null && maybePrefix.isPrefix) { | 759 if (maybePrefix != null && maybePrefix.isPrefix) { |
| 760 PrefixElement prefixElement = maybePrefix; | 760 PrefixElement prefixElement = maybePrefix; |
| 761 if (prefixElement.isDeferred) { | 761 if (prefixElement.isDeferred) { |
| 762 return prefixElement; | 762 return prefixElement; |
| 763 } | 763 } |
| 764 } | 764 } |
| 765 return null; | 765 return null; |
| 766 } | 766 } |
| 767 } | 767 } |
| OLD | NEW |