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 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 if (element.isTopLevel() && node.receiver !== null) { | 128 if (element.isTopLevel() && node.receiver !== null) { |
129 assert(elements[node.receiver].isPrefix()); | 129 assert(elements[node.receiver].isPrefix()); |
130 // Hack: putting null into map overrides receiver of original node. | 130 // Hack: putting null into map overrides receiver of original node. |
131 collector.makeNullPlaceholder(node.receiver); | 131 collector.makeNullPlaceholder(node.receiver); |
132 } | 132 } |
133 } | 133 } |
134 | 134 |
135 internalError(String reason, [Node node]) { | 135 internalError(String reason, [Node node]) { |
136 collector.internalError(reason, node); | 136 collector.internalError(reason, node); |
137 } | 137 } |
| 138 |
| 139 visitClassLiteralSend(Send node) { |
| 140 ClassElement element = elements[node]; |
| 141 collector.makeElementPlaceholder(node.selector, element); |
| 142 } |
138 } | 143 } |
139 | 144 |
140 class PlaceholderCollector extends Visitor { | 145 class PlaceholderCollector extends Visitor { |
141 final Compiler compiler; | 146 final Compiler compiler; |
142 final Set<String> fixedMemberNames; // member names which cannot be renamed. | 147 final Set<String> fixedMemberNames; // member names which cannot be renamed. |
143 final Map<Element, ElementAst> elementAsts; | 148 final Map<Element, ElementAst> elementAsts; |
144 final Set<Node> nullNodes; // Nodes that should not be in output. | 149 final Set<Node> nullNodes; // Nodes that should not be in output. |
145 final Set<Identifier> unresolvedNodes; | 150 final Set<Identifier> unresolvedNodes; |
146 final Map<Element, Set<Identifier>> elementNodes; | 151 final Map<Element, Set<Identifier>> elementNodes; |
147 final Map<FunctionElement, FunctionScope> functionScopes; | 152 final Map<FunctionElement, FunctionScope> functionScopes; |
(...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
630 | 635 |
631 visitBlock(Block node) { | 636 visitBlock(Block node) { |
632 for (Node statement in node.statements.nodes) { | 637 for (Node statement in node.statements.nodes) { |
633 if (statement is VariableDefinitions) { | 638 if (statement is VariableDefinitions) { |
634 makeVarDeclarationTypePlaceholder(statement); | 639 makeVarDeclarationTypePlaceholder(statement); |
635 } | 640 } |
636 } | 641 } |
637 node.visitChildren(this); | 642 node.visitChildren(this); |
638 } | 643 } |
639 } | 644 } |
OLD | NEW |