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

Side by Side Diff: pkg/compiler/lib/src/deferred_load.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/constants/values.dart ('k') | pkg/compiler/lib/src/inferrer/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) 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
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 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/constants/values.dart ('k') | pkg/compiler/lib/src/inferrer/builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698