| 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 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 296 visitSend(Send send) { | 296 visitSend(Send send) { |
| 297 new SendVisitor(this, treeElements).visitSend(send); | 297 new SendVisitor(this, treeElements).visitSend(send); |
| 298 send.visitChildren(this); | 298 send.visitChildren(this); |
| 299 } | 299 } |
| 300 | 300 |
| 301 visitSendSet(SendSet send) { | 301 visitSendSet(SendSet send) { |
| 302 final element = treeElements[send]; | 302 final element = treeElements[send]; |
| 303 if (element !== null) { | 303 if (element !== null) { |
| 304 if (element.isInstanceMember()) { | 304 if (element.isInstanceMember()) { |
| 305 tryMakePrivateIdentifier(send.selector.asIdentifier()); | 305 tryMakePrivateIdentifier(send.selector.asIdentifier()); |
| 306 } else if (element.isTopLevel()) { |
| 307 assert(element is VariableElement || element.isSetter()); |
| 308 makeElementPlaceholder(send.selector, element); |
| 306 } else { | 309 } else { |
| 307 assert(send.selector is Identifier); | 310 assert(send.selector is Identifier); |
| 308 tryMakeLocalPlaceholder(element, send.selector); | 311 tryMakeLocalPlaceholder(element, send.selector); |
| 309 } | 312 } |
| 310 } | 313 } |
| 311 send.visitChildren(this); | 314 send.visitChildren(this); |
| 312 } | 315 } |
| 313 | 316 |
| 314 static bool isPlainTypeName(TypeAnnotation typeAnnotation) { | 317 static bool isPlainTypeName(TypeAnnotation typeAnnotation) { |
| 315 if (typeAnnotation.typeName is !Identifier) return false; | 318 if (typeAnnotation.typeName is !Identifier) return false; |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 412 makeElementPlaceholder(node.name, currentElement); | 415 makeElementPlaceholder(node.name, currentElement); |
| 413 node.visitChildren(this); | 416 node.visitChildren(this); |
| 414 } | 417 } |
| 415 | 418 |
| 416 visitTypedef(Typedef node) { | 419 visitTypedef(Typedef node) { |
| 417 assert(currentElement is TypedefElement); | 420 assert(currentElement is TypedefElement); |
| 418 makeElementPlaceholder(node.name, currentElement); | 421 makeElementPlaceholder(node.name, currentElement); |
| 419 node.visitChildren(this); | 422 node.visitChildren(this); |
| 420 } | 423 } |
| 421 } | 424 } |
| OLD | NEW |