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 part of dart_backend; | 5 part of dart_backend; |
6 | 6 |
7 class LocalPlaceholder { | 7 class LocalPlaceholder { |
8 final String identifier; | 8 final String identifier; |
9 final Set<Node> nodes; | 9 final Set<Node> nodes; |
10 LocalPlaceholder(this.identifier) : nodes = new Set<Node>(); | 10 LocalPlaceholder(this.identifier) : nodes = new Set<Node>(); |
(...skipping 27 matching lines...) Expand all Loading... |
38 } | 38 } |
39 | 39 |
40 class SendVisitor extends Visitor { | 40 class SendVisitor extends Visitor { |
41 final TreeElements elements; | 41 final TreeElements elements; |
42 final PlaceholderCollector collector; | 42 final PlaceholderCollector collector; |
43 | 43 |
44 SendVisitor(this.collector, this.elements); | 44 SendVisitor(this.collector, this.elements); |
45 | 45 |
46 visitSend(Send node) { | 46 visitSend(Send node) { |
47 Element element = elements[node]; | 47 Element element = elements[node]; |
48 if (elements.isTypeLiteral(node)) { | 48 if (elements.isAssert(node)) { |
| 49 return; |
| 50 } else if (elements.isTypeLiteral(node)) { |
49 DartType type = elements.getTypeLiteralType(node); | 51 DartType type = elements.getTypeLiteralType(node); |
50 if (!type.isDynamic) { | 52 if (!type.isDynamic) { |
51 if (type is TypeVariableType) { | 53 if (type is TypeVariableType) { |
52 collector.makeTypeVariablePlaceholder(node.selector, type); | 54 collector.makeTypeVariablePlaceholder(node.selector, type); |
53 } else { | 55 } else { |
54 collector.makeTypePlaceholder(node.selector, type); | 56 collector.makeTypePlaceholder(node.selector, type); |
55 } | 57 } |
56 } | 58 } |
57 } else if (node.isSuperCall) { | 59 } else if (node.isSuperCall) { |
58 if (element != null && element.isConstructor) { | 60 if (element != null && element.isConstructor) { |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 } | 132 } |
131 } | 133 } |
132 } | 134 } |
133 | 135 |
134 visitStaticSend(Send node) { | 136 visitStaticSend(Send node) { |
135 Element element = elements[node]; | 137 Element element = elements[node]; |
136 collector.mirrorRenamer.registerStaticSend( | 138 collector.mirrorRenamer.registerStaticSend( |
137 collector.currentElement, element, node); | 139 collector.currentElement, element, node); |
138 | 140 |
139 if (Elements.isUnresolved(element) | 141 if (Elements.isUnresolved(element) |
| 142 || elements.isAssert(node) |
140 || element.isDeferredLoaderGetter) { | 143 || element.isDeferredLoaderGetter) { |
141 return; | 144 return; |
142 } | 145 } |
143 if (element.isConstructor || element.isFactoryConstructor) { | 146 if (element.isConstructor || element.isFactoryConstructor) { |
144 // Rename named constructor in redirection position: | 147 // Rename named constructor in redirection position: |
145 // class C { C.named(); C.redirecting() : this.named(); } | 148 // class C { C.named(); C.redirecting() : this.named(); } |
146 if (node.receiver is Identifier | 149 if (node.receiver is Identifier |
147 && node.receiver.asIdentifier().isThis()) { | 150 && node.receiver.asIdentifier().isThis()) { |
148 assert(node.selector is Identifier); | 151 assert(node.selector is Identifier); |
149 collector.tryMakeConstructorPlaceholder(node, element); | 152 collector.tryMakeConstructorPlaceholder(node, element); |
(...skipping 564 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
714 | 717 |
715 visitBlock(Block node) { | 718 visitBlock(Block node) { |
716 for (Node statement in node.statements.nodes) { | 719 for (Node statement in node.statements.nodes) { |
717 if (statement is VariableDefinitions) { | 720 if (statement is VariableDefinitions) { |
718 makeVarDeclarationTypePlaceholder(statement); | 721 makeVarDeclarationTypePlaceholder(statement); |
719 } | 722 } |
720 } | 723 } |
721 node.visitChildren(this); | 724 node.visitChildren(this); |
722 } | 725 } |
723 } | 726 } |
OLD | NEW |