| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |