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

Side by Side Diff: sdk/lib/_internal/compiler/implementation/dart_backend/placeholder_collector.dart

Issue 11348294: Follow-up to https://chromiumcodereview.appspot.com/11416144/. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fixed dart2dart malformed type handling in visitNewExpression(). Fixed comments. Created 8 years 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 | sdk/lib/_internal/compiler/implementation/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) 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 dart_backend; 5 part of dart_backend;
6 6
7 class LocalPlaceholder { 7 class LocalPlaceholder {
8 final String identifier; 8 final String identifier;
9 final Set<Node> nodes; 9 final Set<Node> nodes;
10 LocalPlaceholder(this.identifier) : nodes = new Set<Node>(); 10 LocalPlaceholder(this.identifier) : nodes = new Set<Node>();
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after
358 358
359 visitNode(Node node) { node.visitChildren(this); } // We must go deeper. 359 visitNode(Node node) { node.visitChildren(this); } // We must go deeper.
360 360
361 visitNewExpression(NewExpression node) { 361 visitNewExpression(NewExpression node) {
362 Send send = node.send; 362 Send send = node.send;
363 InterfaceType type = treeElements.getType(node); 363 InterfaceType type = treeElements.getType(node);
364 assert(type != null); 364 assert(type != null);
365 Element constructor = treeElements[send]; 365 Element constructor = treeElements[send];
366 assert(constructor != null); 366 assert(constructor != null);
367 assert(send.receiver == null); 367 assert(send.receiver == null);
368 if (!Elements.isErroneousElement(constructor) && 368
369 !Elements.isMalformedElement(constructor)) { 369 // For constructors that refer to malformed class types retrieve
370 // class type like it is done in [ SsaBuilder.visitNewSend ].
371 if (type.kind == TypeKind.MALFORMED_TYPE) {
372 type = constructor.getEnclosingClass().thisType;
373 }
374
375 if (!Elements.isUnresolved(constructor)) {
370 makeConstructorPlaceholder(node.send.selector, constructor, type); 376 makeConstructorPlaceholder(node.send.selector, constructor, type);
371 // TODO(smok): Should this be in visitNamedArgument? 377 // TODO(smok): Should this be in visitNamedArgument?
372 // Field names can be exposed as names of optional arguments, e.g. 378 // Field names can be exposed as names of optional arguments, e.g.
373 // class C { 379 // class C {
374 // final field; 380 // final field;
375 // C([this.field]); 381 // C([this.field]);
376 // } 382 // }
377 // Do not forget to rename them as well. 383 // Do not forget to rename them as well.
378 FunctionElement constructorFunction = constructor; 384 FunctionElement constructorFunction = constructor;
379 Link<Element> optionalParameters = 385 Link<Element> optionalParameters =
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
616 622
617 visitBlock(Block node) { 623 visitBlock(Block node) {
618 for (Node statement in node.statements.nodes) { 624 for (Node statement in node.statements.nodes) {
619 if (statement is VariableDefinitions) { 625 if (statement is VariableDefinitions) {
620 makeVarDeclarationTypePlaceholder(statement); 626 makeVarDeclarationTypePlaceholder(statement);
621 } 627 }
622 } 628 }
623 node.visitChildren(this); 629 node.visitChildren(this);
624 } 630 }
625 } 631 }
OLDNEW
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/resolution/members.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698