| 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 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 307 compiler.cancel(reason: reason, node: node); | 307 compiler.cancel(reason: reason, node: node); |
| 308 } | 308 } |
| 309 | 309 |
| 310 void unreachable() { internalError('Unreachable case'); } | 310 void unreachable() { internalError('Unreachable case'); } |
| 311 | 311 |
| 312 visit(Node node) => (node === null) ? null : node.accept(this); | 312 visit(Node node) => (node === null) ? null : node.accept(this); |
| 313 | 313 |
| 314 visitNode(Node node) { node.visitChildren(this); } // We must go deeper. | 314 visitNode(Node node) { node.visitChildren(this); } // We must go deeper. |
| 315 | 315 |
| 316 visitSend(Send send) { | 316 visitSend(Send send) { |
| 317 Element element = treeElements[send]; |
| 318 if (element !== null && element.isErroneous()) { |
| 319 // TODO(antonm): this is an unresolved constructor, not a dynamic send. |
| 320 ErroneousElement erroneousElement = element; |
| 321 compiler.cancel(reason: erroneousElement.errorMessage.toString(), |
| 322 node: send); |
| 323 } |
| 317 new SendVisitor(this, treeElements).visitSend(send); | 324 new SendVisitor(this, treeElements).visitSend(send); |
| 318 send.visitChildren(this); | 325 send.visitChildren(this); |
| 319 } | 326 } |
| 320 | 327 |
| 321 visitSendSet(SendSet send) { | 328 visitSendSet(SendSet send) { |
| 322 if (send.selector is Identifier) { | 329 if (send.selector is Identifier) { |
| 323 tryMakePrivateIdentifier(send.selector.asIdentifier()); | 330 tryMakePrivateIdentifier(send.selector.asIdentifier()); |
| 324 } | 331 } |
| 325 final element = treeElements[send]; | 332 final element = treeElements[send]; |
| 326 if (element !== null) { | 333 if (element !== null) { |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 444 visit(node.defaultClause.typeArguments); | 451 visit(node.defaultClause.typeArguments); |
| 445 } | 452 } |
| 446 } | 453 } |
| 447 | 454 |
| 448 visitTypedef(Typedef node) { | 455 visitTypedef(Typedef node) { |
| 449 assert(currentElement is TypedefElement); | 456 assert(currentElement is TypedefElement); |
| 450 makeElementPlaceholder(node.name, currentElement); | 457 makeElementPlaceholder(node.name, currentElement); |
| 451 node.visitChildren(this); | 458 node.visitChildren(this); |
| 452 } | 459 } |
| 453 } | 460 } |
| OLD | NEW |