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

Side by Side Diff: pkg/compiler/lib/src/compile_time_constants.dart

Issue 1423623008: Improve messages and static use for super/this-calls. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Updated cf. comment. Created 5 years, 1 month 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 | « no previous file | pkg/compiler/lib/src/diagnostics/messages.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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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.compile_time_constant_evaluator; 5 library dart2js.compile_time_constant_evaluator;
6 6
7 import 'common.dart'; 7 import 'common.dart';
8 import 'common/resolution.dart' show 8 import 'common/resolution.dart' show
9 Resolution; 9 Resolution;
10 import 'common/tasks.dart' show 10 import 'common/tasks.dart' show
(...skipping 1133 matching lines...) Expand 10 before | Expand all | Expand 10 after
1144 1144
1145 if (initializerList != null) { 1145 if (initializerList != null) {
1146 for (Link<Node> link = initializerList.nodes; 1146 for (Link<Node> link = initializerList.nodes;
1147 !link.isEmpty; 1147 !link.isEmpty;
1148 link = link.tail) { 1148 link = link.tail) {
1149 assert(link.head is Send); 1149 assert(link.head is Send);
1150 if (link.head is! SendSet) { 1150 if (link.head is! SendSet) {
1151 // A super initializer or constructor redirection. 1151 // A super initializer or constructor redirection.
1152 Send call = link.head; 1152 Send call = link.head;
1153 FunctionElement target = elements[call]; 1153 FunctionElement target = elements[call];
1154 List<AstConstant> compiledArguments = evaluateArgumentsToConstructor( 1154 if (!target.isMalformed) {
1155 call, elements.getSelector(call).callStructure, call.arguments, 1155 List<AstConstant> compiledArguments =
1156 target, compileArgument: evaluateConstant); 1156 evaluateArgumentsToConstructor(
1157 evaluateSuperOrRedirectSend(compiledArguments, target); 1157 call,
1158 elements.getSelector(call).callStructure,
1159 call.arguments,
1160 target,
1161 compileArgument: evaluateConstant);
1162 evaluateSuperOrRedirectSend(compiledArguments, target);
1163 }
1158 foundSuperOrRedirect = true; 1164 foundSuperOrRedirect = true;
1159 } else { 1165 } else {
1160 // A field initializer. 1166 // A field initializer.
1161 SendSet init = link.head; 1167 SendSet init = link.head;
1162 Link<Node> initArguments = init.arguments; 1168 Link<Node> initArguments = init.arguments;
1163 assert(!initArguments.isEmpty && initArguments.tail.isEmpty); 1169 assert(!initArguments.isEmpty && initArguments.tail.isEmpty);
1164 AstConstant fieldValue = evaluate(initArguments.head); 1170 AstConstant fieldValue = evaluate(initArguments.head);
1165 updateFieldValue(init, elements[init], fieldValue); 1171 updateFieldValue(init, elements[init], fieldValue);
1166 } 1172 }
1167 } 1173 }
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
1272 class _CompilerEnvironment implements Environment { 1278 class _CompilerEnvironment implements Environment {
1273 final Compiler compiler; 1279 final Compiler compiler;
1274 1280
1275 _CompilerEnvironment(this.compiler); 1281 _CompilerEnvironment(this.compiler);
1276 1282
1277 @override 1283 @override
1278 String readFromEnvironment(String name) { 1284 String readFromEnvironment(String name) {
1279 return compiler.fromEnvironment(name); 1285 return compiler.fromEnvironment(name);
1280 } 1286 }
1281 } 1287 }
OLDNEW
« no previous file with comments | « no previous file | pkg/compiler/lib/src/diagnostics/messages.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698