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

Side by Side Diff: pkg/compiler/lib/src/resolution/resolution_strategy.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/resolution/members.dart ('k') | pkg/compiler/lib/src/ssa/builder.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) 2017, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2017, 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 dart2js.resolution_strategy; 5 library dart2js.resolution_strategy;
6 6
7 import '../common.dart'; 7 import '../common.dart';
8 import '../common_elements.dart'; 8 import '../common_elements.dart';
9 import '../common/backend_api.dart'; 9 import '../common/backend_api.dart';
10 import '../common/names.dart'; 10 import '../common/names.dart';
(...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after
512 ConstantValue constant = 512 ConstantValue constant =
513 _compiler.constants.getConstantValue(annotation.constant); 513 _compiler.constants.getConstantValue(annotation.constant);
514 if (constant == null || constant is! ConstructedConstantValue) continue; 514 if (constant == null || constant is! ConstructedConstantValue) continue;
515 ConstructedConstantValue constructedConstant = constant; 515 ConstructedConstantValue constructedConstant = constant;
516 if (constructedConstant.type.element == 516 if (constructedConstant.type.element ==
517 _commonElements.jsAnnotationClass) { 517 _commonElements.jsAnnotationClass) {
518 ConstantValue value = constructedConstant.fields[nameField]; 518 ConstantValue value = constructedConstant.fields[nameField];
519 String name; 519 String name;
520 if (value.isString) { 520 if (value.isString) {
521 StringConstantValue stringValue = value; 521 StringConstantValue stringValue = value;
522 name = stringValue.primitiveValue.slowToString(); 522 name = stringValue.primitiveValue;
523 } else { 523 } else {
524 // TODO(jacobr): report a warning if the value is not a String. 524 // TODO(jacobr): report a warning if the value is not a String.
525 name = ''; 525 name = '';
526 } 526 }
527 return name; 527 return name;
528 } 528 }
529 } 529 }
530 return null; 530 return null;
531 } 531 }
532 532
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
635 } 635 }
636 } 636 }
637 }); 637 });
638 }); 638 });
639 } 639 }
640 640
641 _compiler.libraryLoader.libraries 641 _compiler.libraryLoader.libraries
642 .forEach(processJsInteropAnnotationsInLibrary); 642 .forEach(processJsInteropAnnotationsInLibrary);
643 } 643 }
644 } 644 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/resolution/members.dart ('k') | pkg/compiler/lib/src/ssa/builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698