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

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

Issue 10947024: Made dart2js constructor lookup logic "private"-aware, fixed 4740 bug. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 3 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
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 class LocalPlaceholder implements Hashable { 5 class LocalPlaceholder implements Hashable {
6 final String identifier; 6 final String identifier;
7 final Set<Node> nodes; 7 final Set<Node> nodes;
8 LocalPlaceholder(this.identifier) : nodes = new Set<Node>(); 8 LocalPlaceholder(this.identifier) : nodes = new Set<Node>();
9 int hashCode() => identifier.hashCode(); 9 int hashCode() => identifier.hashCode();
10 String toString() => 10 String toString() =>
(...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after
439 if (node.typeName is Send) { 439 if (node.typeName is Send) {
440 final element = treeElements[node]; 440 final element = treeElements[node];
441 if (element !== null) { 441 if (element !== null) {
442 final send = node.typeName.asSend(); 442 final send = node.typeName.asSend();
443 Identifier receiver = send.receiver; 443 Identifier receiver = send.receiver;
444 Identifier selector = send.selector; 444 Identifier selector = send.selector;
445 hasPrefix() { 445 hasPrefix() {
446 if (element is TypedefElement) return true; 446 if (element is TypedefElement) return true;
447 ClassElement classElement = element; 447 ClassElement classElement = element;
448 final constructor = classElement.lookupConstructor( 448 final constructor = classElement.lookupConstructor(
449 receiver.source, selector.source); 449 currentElement.getLibrary(),
450 receiver.source,
451 selector.source);
450 return constructor === null; 452 return constructor === null;
451 } 453 }
452 if (!hasPrefix()) target = send.receiver; 454 if (!hasPrefix()) target = send.receiver;
453 } 455 }
454 } 456 }
455 // TODO(antonm): is there a better way to detect unresolved types? 457 // TODO(antonm): is there a better way to detect unresolved types?
456 if (type.element !== compiler.types.dynamicType.element) { 458 if (type.element !== compiler.types.dynamicType.element) {
457 makeTypePlaceholder(target, type); 459 makeTypePlaceholder(target, type);
458 } else { 460 } else {
459 if (!isDynamicType(node)) makeUnresolvedPlaceholder(target); 461 if (!isDynamicType(node)) makeUnresolvedPlaceholder(target);
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
584 586
585 visitBlock(Block node) { 587 visitBlock(Block node) {
586 for (Node statement in node.statements.nodes) { 588 for (Node statement in node.statements.nodes) {
587 if (statement is VariableDefinitions) { 589 if (statement is VariableDefinitions) {
588 makeVarDeclarationTypePlaceholder(statement); 590 makeVarDeclarationTypePlaceholder(statement);
589 } 591 }
590 } 592 }
591 node.visitChildren(this); 593 node.visitChildren(this);
592 } 594 }
593 } 595 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698