| 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 'package:front_end/src/fasta/scanner.dart' | 5 import 'package:front_end/src/fasta/scanner.dart' |
| 6 show BeginGroupToken, StringToken, Token; | 6 show BeginGroupToken, StringToken, Token; |
| 7 import 'package:front_end/src/fasta/scanner.dart' as Tokens show EOF_TOKEN; | 7 import 'package:front_end/src/fasta/scanner.dart' as Tokens show EOF_TOKEN; |
| 8 | 8 |
| 9 import '../common.dart'; | 9 import '../common.dart'; |
| 10 import '../common_elements.dart' show CommonElements, ElementEnvironment; | 10 import '../common_elements.dart' show CommonElements, ElementEnvironment; |
| (...skipping 553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 564 ConstructedConstantValue constructedObject = value; | 564 ConstructedConstantValue constructedObject = value; |
| 565 if (constructedObject.type.element != annotationClass) return null; | 565 if (constructedObject.type.element != annotationClass) return null; |
| 566 | 566 |
| 567 Iterable<ConstantValue> fields = constructedObject.fields.values; | 567 Iterable<ConstantValue> fields = constructedObject.fields.values; |
| 568 // TODO(sra): Better validation of the constant. | 568 // TODO(sra): Better validation of the constant. |
| 569 if (fields.length != 1 || fields.single is! StringConstantValue) { | 569 if (fields.length != 1 || fields.single is! StringConstantValue) { |
| 570 throw new SpannableAssertionFailure( | 570 throw new SpannableAssertionFailure( |
| 571 spannable, 'Annotations needs one string: ${value.toStructuredText()}'); | 571 spannable, 'Annotations needs one string: ${value.toStructuredText()}'); |
| 572 } | 572 } |
| 573 StringConstantValue specStringConstant = fields.single; | 573 StringConstantValue specStringConstant = fields.single; |
| 574 return specStringConstant.toDartString().slowToString(); | 574 return specStringConstant.primitiveValue; |
| 575 } | 575 } |
| OLD | NEW |