| 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 import '../common.dart'; | 5 import '../common.dart'; |
| 6 import '../common/backend_api.dart' show ForeignResolver; | 6 import '../common/backend_api.dart' show ForeignResolver; |
| 7 import '../common/resolution.dart' show ParsingContext, Resolution; | 7 import '../common/resolution.dart' show ParsingContext, Resolution; |
| 8 import '../compiler.dart' show Compiler; | 8 import '../compiler.dart' show Compiler; |
| 9 import '../constants/values.dart'; | 9 import '../constants/values.dart'; |
| 10 import '../common_elements.dart' show CommonElements; | 10 import '../common_elements.dart' show CommonElements; |
| (...skipping 879 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 890 ConstructedConstantValue constructedObject = value; | 890 ConstructedConstantValue constructedObject = value; |
| 891 if (constructedObject.type.element != annotationClass) continue; | 891 if (constructedObject.type.element != annotationClass) continue; |
| 892 | 892 |
| 893 Iterable<ConstantValue> fields = constructedObject.fields.values; | 893 Iterable<ConstantValue> fields = constructedObject.fields.values; |
| 894 // TODO(sra): Better validation of the constant. | 894 // TODO(sra): Better validation of the constant. |
| 895 if (fields.length != 1 || !fields.single.isString) { | 895 if (fields.length != 1 || !fields.single.isString) { |
| 896 reporter.internalError(CURRENT_ELEMENT_SPANNABLE, | 896 reporter.internalError(CURRENT_ELEMENT_SPANNABLE, |
| 897 'Annotations needs one string: ${value.toStructuredText()}'); | 897 'Annotations needs one string: ${value.toStructuredText()}'); |
| 898 } | 898 } |
| 899 StringConstantValue specStringConstant = fields.single; | 899 StringConstantValue specStringConstant = fields.single; |
| 900 String specString = specStringConstant.toDartString().slowToString(); | 900 String specString = specStringConstant.primitiveValue; |
| 901 for (final typeString in specString.split('|')) { | 901 for (final typeString in specString.split('|')) { |
| 902 var type = NativeBehavior._parseType(typeString, lookupType); | 902 var type = NativeBehavior._parseType(typeString, lookupType); |
| 903 if (types == null) types = []; | 903 if (types == null) types = []; |
| 904 types.add(type); | 904 types.add(type); |
| 905 } | 905 } |
| 906 } | 906 } |
| 907 return types; | 907 return types; |
| 908 } | 908 } |
| 909 | 909 |
| 910 /// Models the behavior of having intances of [type] escape from Dart code | 910 /// Models the behavior of having intances of [type] escape from Dart code |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1045 @override | 1045 @override |
| 1046 bool get trustJSInteropTypeAnnotations => | 1046 bool get trustJSInteropTypeAnnotations => |
| 1047 compiler.options.trustJSInteropTypeAnnotations; | 1047 compiler.options.trustJSInteropTypeAnnotations; |
| 1048 | 1048 |
| 1049 @override | 1049 @override |
| 1050 DiagnosticReporter get reporter => compiler.reporter; | 1050 DiagnosticReporter get reporter => compiler.reporter; |
| 1051 | 1051 |
| 1052 @override | 1052 @override |
| 1053 Resolution get resolution => compiler.resolution; | 1053 Resolution get resolution => compiler.resolution; |
| 1054 } | 1054 } |
| OLD | NEW |