| 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 'common/tasks.dart' show CompilerTask; | 7 import 'common/tasks.dart' show CompilerTask; |
| 8 import 'common.dart'; | 8 import 'common.dart'; |
| 9 import 'compiler.dart' show Compiler; | 9 import 'compiler.dart' show Compiler; |
| 10 import 'constants/expressions.dart' show ConstantExpression; | 10 import 'constants/expressions.dart' show ConstantExpression; |
| (...skipping 1062 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1073 assert(metadatas != null); | 1073 assert(metadatas != null); |
| 1074 for (MetadataAnnotation metadata in metadatas) { | 1074 for (MetadataAnnotation metadata in metadatas) { |
| 1075 metadata.ensureResolved(compiler.resolution); | 1075 metadata.ensureResolved(compiler.resolution); |
| 1076 ConstantValue value = | 1076 ConstantValue value = |
| 1077 compiler.constants.getConstantValue(metadata.constant); | 1077 compiler.constants.getConstantValue(metadata.constant); |
| 1078 ResolutionDartType type = value.getType(compiler.commonElements); | 1078 ResolutionDartType type = value.getType(compiler.commonElements); |
| 1079 Element element = type.element; | 1079 Element element = type.element; |
| 1080 if (element == compiler.commonElements.deferredLibraryClass) { | 1080 if (element == compiler.commonElements.deferredLibraryClass) { |
| 1081 ConstructedConstantValue constant = value; | 1081 ConstructedConstantValue constant = value; |
| 1082 StringConstantValue s = constant.fields.values.single; | 1082 StringConstantValue s = constant.fields.values.single; |
| 1083 result = s.primitiveValue.slowToString(); | 1083 result = s.primitiveValue; |
| 1084 break; | 1084 break; |
| 1085 } | 1085 } |
| 1086 } | 1086 } |
| 1087 } | 1087 } |
| 1088 assert(result != null); | 1088 assert(result != null); |
| 1089 return result; | 1089 return result; |
| 1090 } | 1090 } |
| 1091 | 1091 |
| 1092 bool operator ==(other) { | 1092 bool operator ==(other) { |
| 1093 if (other is! _DeclaredDeferredImport) return false; | 1093 if (other is! _DeclaredDeferredImport) return false; |
| 1094 return declaration == other.declaration; | 1094 return declaration == other.declaration; |
| 1095 } | 1095 } |
| 1096 | 1096 |
| 1097 int get hashCode => declaration.hashCode * 17; | 1097 int get hashCode => declaration.hashCode * 17; |
| 1098 | 1098 |
| 1099 String toString() => '$declaration'; | 1099 String toString() => '$declaration'; |
| 1100 } | 1100 } |
| OLD | NEW |