| 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 457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 468 // coreLibPrefix.topLevels. | 468 // coreLibPrefix.topLevels. |
| 469 Element typeElement = type.element; | 469 Element typeElement = type.element; |
| 470 Element dynamicTypeElement = compiler.types.dynamicType.element; | 470 Element dynamicTypeElement = compiler.types.dynamicType.element; |
| 471 if (hasPrefix && | 471 if (hasPrefix && |
| 472 (typeElement.getLibrary() === coreLibrary || | 472 (typeElement.getLibrary() === coreLibrary || |
| 473 typeElement === dynamicTypeElement)) { | 473 typeElement === dynamicTypeElement)) { |
| 474 makeNullPlaceholder(node.typeName.asSend().receiver); | 474 makeNullPlaceholder(node.typeName.asSend().receiver); |
| 475 } else { | 475 } else { |
| 476 if (hasPrefix) { | 476 if (hasPrefix) { |
| 477 assert(node.typeName is Send); | 477 assert(node.typeName is Send); |
| 478 assert(node.typeName.receiver is Identifier); | 478 Send typeName = node.typeName; |
| 479 assert(node.typeName.selector is Identifier); | 479 assert(typeName.receiver is Identifier); |
| 480 makeNullPlaceholder(node.typeName.receiver); | 480 assert(typeName.selector is Identifier); |
| 481 makeNullPlaceholder(typeName.receiver); |
| 481 } | 482 } |
| 482 if (typeElement !== dynamicTypeElement) { | 483 if (typeElement !== dynamicTypeElement) { |
| 483 makeTypePlaceholder(target, type); | 484 makeTypePlaceholder(target, type); |
| 484 } else { | 485 } else { |
| 485 if (!isDynamicType(node)) makeUnresolvedPlaceholder(target); | 486 if (!isDynamicType(node)) makeUnresolvedPlaceholder(target); |
| 486 } | 487 } |
| 487 } | 488 } |
| 488 } | 489 } |
| 489 // Trying to differentiate new A.foo() and lib.A cases. In the latter case | 490 // Trying to differentiate new A.foo() and lib.A cases. In the latter case |
| 490 // we don't want to go deeper into typeName. | 491 // we don't want to go deeper into typeName. |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 630 | 631 |
| 631 visitBlock(Block node) { | 632 visitBlock(Block node) { |
| 632 for (Node statement in node.statements.nodes) { | 633 for (Node statement in node.statements.nodes) { |
| 633 if (statement is VariableDefinitions) { | 634 if (statement is VariableDefinitions) { |
| 634 makeVarDeclarationTypePlaceholder(statement); | 635 makeVarDeclarationTypePlaceholder(statement); |
| 635 } | 636 } |
| 636 } | 637 } |
| 637 node.visitChildren(this); | 638 node.visitChildren(this); |
| 638 } | 639 } |
| 639 } | 640 } |
| OLD | NEW |