Chromium Code Reviews| 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 { | 5 class LocalPlaceholder { |
| 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 446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 457 } | 457 } |
| 458 // TODO(antonm): is there a better way to detect unresolved types? | 458 // TODO(antonm): is there a better way to detect unresolved types? |
| 459 // Corner case: dart:core type with a prefix. | 459 // Corner case: dart:core type with a prefix. |
| 460 // Most probably there are some additional problems with | 460 // Most probably there are some additional problems with |
| 461 // coreLibPrefix.topLevels. | 461 // coreLibPrefix.topLevels. |
| 462 Element typeElement = type.element; | 462 Element typeElement = type.element; |
| 463 Element dynamicTypeElement = compiler.types.dynamicType.element; | 463 Element dynamicTypeElement = compiler.types.dynamicType.element; |
| 464 if (hasPrefix && | 464 if (hasPrefix && |
| 465 (typeElement.getLibrary() === coreLibrary || | 465 (typeElement.getLibrary() === coreLibrary || |
| 466 typeElement === dynamicTypeElement)) { | 466 typeElement === dynamicTypeElement)) { |
| 467 makeNullPlaceholder(node.typeName.receiver); | 467 Send typeName = node.typeName; |
| 468 makeNullPlaceholder(typeName.receiver); | |
|
ahe
2012/10/03 14:56:33
node.typeName.asSend().receiver
karlklose
2012/10/04 08:50:00
Done.
| |
| 468 } else { | 469 } else { |
| 469 if (typeElement !== dynamicTypeElement) { | 470 if (typeElement !== dynamicTypeElement) { |
| 470 makeTypePlaceholder(target, type); | 471 makeTypePlaceholder(target, type); |
| 471 } else { | 472 } else { |
| 472 if (!isDynamicType(node)) makeUnresolvedPlaceholder(target); | 473 if (!isDynamicType(node)) makeUnresolvedPlaceholder(target); |
| 473 } | 474 } |
| 474 } | 475 } |
| 475 } | 476 } |
| 476 node.visitChildren(this); | 477 node.visitChildren(this); |
| 477 } | 478 } |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 608 | 609 |
| 609 visitBlock(Block node) { | 610 visitBlock(Block node) { |
| 610 for (Node statement in node.statements.nodes) { | 611 for (Node statement in node.statements.nodes) { |
| 611 if (statement is VariableDefinitions) { | 612 if (statement is VariableDefinitions) { |
| 612 makeVarDeclarationTypePlaceholder(statement); | 613 makeVarDeclarationTypePlaceholder(statement); |
| 613 } | 614 } |
| 614 } | 615 } |
| 615 node.visitChildren(this); | 616 node.visitChildren(this); |
| 616 } | 617 } |
| 617 } | 618 } |
| OLD | NEW |