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

Side by Side Diff: sdk/lib/_internal/compiler/implementation/resolution/members.dart

Issue 25028002: Always visit initializing constants. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | 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 part of resolution; 5 part of resolution;
6 6
7 abstract class TreeElements { 7 abstract class TreeElements {
8 Element get currentElement; 8 Element get currentElement;
9 Set<Node> get superUses; 9 Set<Node> get superUses;
10 10
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after
443 Node tree = element.parseNode(compiler); 443 Node tree = element.parseNode(compiler);
444 if(element.modifiers.isStatic() && element.variables.isTopLevel()) { 444 if(element.modifiers.isStatic() && element.variables.isTopLevel()) {
445 error(element.modifiers.getStatic(), 445 error(element.modifiers.getStatic(),
446 MessageKind.TOP_LEVEL_VARIABLE_DECLARED_STATIC); 446 MessageKind.TOP_LEVEL_VARIABLE_DECLARED_STATIC);
447 } 447 }
448 ResolverVisitor visitor = visitorFor(element); 448 ResolverVisitor visitor = visitorFor(element);
449 visitor.useElement(tree, element); 449 visitor.useElement(tree, element);
450 450
451 SendSet send = tree.asSendSet(); 451 SendSet send = tree.asSendSet();
452 if (send != null) { 452 if (send != null) {
453 if (!compiler.analyzeSignaturesOnly) { 453 // TODO(johnniwinther): Avoid analyzing initializers if
454 visitor.visit(send.arguments.head); 454 // [Compiler.analyzeSignaturesOnly] is set.
455 } 455 visitor.visit(send.arguments.head);
456 } else if (element.modifiers.isConst()) { 456 } else if (element.modifiers.isConst()) {
457 compiler.reportError(element, MessageKind.CONST_WITHOUT_INITIALIZER); 457 compiler.reportError(element, MessageKind.CONST_WITHOUT_INITIALIZER);
458 } 458 }
459 459
460 if (Elements.isStaticOrTopLevelField(element)) { 460 if (Elements.isStaticOrTopLevelField(element)) {
461 if (tree.asSendSet() != null) { 461 if (tree.asSendSet() != null) {
462 // TODO(13429): We could do better here by using the 462 // TODO(13429): We could do better here by using the
463 // constant handler to figure out if it's a lazy field or not. 463 // constant handler to figure out if it's a lazy field or not.
464 compiler.backend.registerLazyField(visitor.mapping); 464 compiler.backend.registerLazyField(visitor.mapping);
465 } else { 465 } else {
(...skipping 3921 matching lines...) Expand 10 before | Expand all | Expand 10 after
4387 return e; 4387 return e;
4388 } 4388 }
4389 4389
4390 /// Assumed to be called by [resolveRedirectingFactory]. 4390 /// Assumed to be called by [resolveRedirectingFactory].
4391 Element visitReturn(Return node) { 4391 Element visitReturn(Return node) {
4392 Node expression = node.expression; 4392 Node expression = node.expression;
4393 return finishConstructorReference(visit(expression), 4393 return finishConstructorReference(visit(expression),
4394 expression, expression); 4394 expression, expression);
4395 } 4395 }
4396 } 4396 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698