Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(351)

Side by Side Diff: lib/compiler/implementation/dart_backend/placeholder_collector.dart

Issue 10825475: Just ignore erroneous elements. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 10 matching lines...) Expand all
21 visitForeignSend(Send node) {} 21 visitForeignSend(Send node) {}
22 22
23 visitClosureSend(Send node) { 23 visitClosureSend(Send node) {
24 final element = elements[node]; 24 final element = elements[node];
25 if (element !== null) { 25 if (element !== null) {
26 collector.tryMakeLocalPlaceholder(element, node.selector); 26 collector.tryMakeLocalPlaceholder(element, node.selector);
27 } 27 }
28 } 28 }
29 29
30 visitDynamicSend(Send node) { 30 visitDynamicSend(Send node) {
31 Element element = elements[node];
32 if (element !== null && element.isErroneous()) return;
31 tryRenamePrivateSelector(node); 33 tryRenamePrivateSelector(node);
32 } 34 }
33 35
34 visitGetterSend(Send node) { 36 visitGetterSend(Send node) {
35 final element = elements[node]; 37 final element = elements[node];
36 // element === null means dynamic property access. 38 // element === null means dynamic property access.
37 if (element === null || element.isMember()) { 39 if (element === null || element.isMember()) {
38 tryRenamePrivateSelector(node); 40 tryRenamePrivateSelector(node);
39 return; 41 return;
40 } 42 }
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 compiler.cancel(reason: reason, node: node); 309 compiler.cancel(reason: reason, node: node);
308 } 310 }
309 311
310 void unreachable() { internalError('Unreachable case'); } 312 void unreachable() { internalError('Unreachable case'); }
311 313
312 visit(Node node) => (node === null) ? null : node.accept(this); 314 visit(Node node) => (node === null) ? null : node.accept(this);
313 315
314 visitNode(Node node) { node.visitChildren(this); } // We must go deeper. 316 visitNode(Node node) { node.visitChildren(this); } // We must go deeper.
315 317
316 visitSend(Send send) { 318 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 }
324 new SendVisitor(this, treeElements).visitSend(send); 319 new SendVisitor(this, treeElements).visitSend(send);
325 send.visitChildren(this); 320 send.visitChildren(this);
326 } 321 }
327 322
328 visitSendSet(SendSet send) { 323 visitSendSet(SendSet send) {
329 if (send.selector is Identifier) { 324 if (send.selector is Identifier) {
330 tryMakePrivateIdentifier(send.selector.asIdentifier()); 325 tryMakePrivateIdentifier(send.selector.asIdentifier());
331 } 326 }
332 final element = treeElements[send]; 327 final element = treeElements[send];
333 if (element !== null) { 328 if (element !== null) {
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
466 visit(node.defaultClause.typeArguments); 461 visit(node.defaultClause.typeArguments);
467 } 462 }
468 } 463 }
469 464
470 visitTypedef(Typedef node) { 465 visitTypedef(Typedef node) {
471 assert(currentElement is TypedefElement); 466 assert(currentElement is TypedefElement);
472 makeElementPlaceholder(node.name, currentElement); 467 makeElementPlaceholder(node.name, currentElement);
473 node.visitChildren(this); 468 node.visitChildren(this);
474 } 469 }
475 } 470 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698