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

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

Issue 10854218: dart2dart Collect type placeholder for default class. (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 | tests/compiler/dart2js/unparser_test.dart » ('j') | 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 396 matching lines...) Expand 10 before | Expand all | Expand 10 after
407 } 407 }
408 } 408 }
409 } 409 }
410 node.visitChildren(this); 410 node.visitChildren(this);
411 } 411 }
412 412
413 visitClassNode(ClassNode node) { 413 visitClassNode(ClassNode node) {
414 assert(currentElement is ClassElement); 414 assert(currentElement is ClassElement);
415 makeElementPlaceholder(node.name, currentElement); 415 makeElementPlaceholder(node.name, currentElement);
416 node.visitChildren(this); 416 node.visitChildren(this);
417 if (node.defaultClause !== null) {
418 // Can't just visit class node's default clause because of the bug in the
419 // resolver, it just crashes when it meets type variable.
420 Type defaultType = (currentElement as ClassElement).defaultClass;
421 assert(defaultType !== null);
422 makeTypePlaceholder(node.defaultClause.typeName, defaultType);
423 visit(node.defaultClause.typeArguments);
424 }
417 } 425 }
418 426
419 visitTypedef(Typedef node) { 427 visitTypedef(Typedef node) {
420 assert(currentElement is TypedefElement); 428 assert(currentElement is TypedefElement);
421 makeElementPlaceholder(node.name, currentElement); 429 makeElementPlaceholder(node.name, currentElement);
422 node.visitChildren(this); 430 node.visitChildren(this);
423 } 431 }
424 } 432 }
OLDNEW
« no previous file with comments | « no previous file | tests/compiler/dart2js/unparser_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698