Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(339)

Side by Side Diff: pkg/compiler/lib/src/native/resolver.dart

Issue 2864363002: Remove DartString from constants. (Closed)
Patch Set: Remove toDartString Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « pkg/compiler/lib/src/native/behavior.dart ('k') | pkg/compiler/lib/src/resolution/members.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/native/behavior.dart ('k') | pkg/compiler/lib/src/resolution/members.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698