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

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

Issue 11086004: Remove some warnings and dead code in dart2js. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 2 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 | lib/compiler/implementation/js_backend/constant_system_javascript.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 { 5 class LocalPlaceholder {
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 457 matching lines...) Expand 10 before | Expand all | Expand 10 after
468 // coreLibPrefix.topLevels. 468 // coreLibPrefix.topLevels.
469 Element typeElement = type.element; 469 Element typeElement = type.element;
470 Element dynamicTypeElement = compiler.types.dynamicType.element; 470 Element dynamicTypeElement = compiler.types.dynamicType.element;
471 if (hasPrefix && 471 if (hasPrefix &&
472 (typeElement.getLibrary() === coreLibrary || 472 (typeElement.getLibrary() === coreLibrary ||
473 typeElement === dynamicTypeElement)) { 473 typeElement === dynamicTypeElement)) {
474 makeNullPlaceholder(node.typeName.asSend().receiver); 474 makeNullPlaceholder(node.typeName.asSend().receiver);
475 } else { 475 } else {
476 if (hasPrefix) { 476 if (hasPrefix) {
477 assert(node.typeName is Send); 477 assert(node.typeName is Send);
478 assert(node.typeName.receiver is Identifier); 478 Send typeName = node.typeName;
479 assert(node.typeName.selector is Identifier); 479 assert(typeName.receiver is Identifier);
480 makeNullPlaceholder(node.typeName.receiver); 480 assert(typeName.selector is Identifier);
481 makeNullPlaceholder(typeName.receiver);
481 } 482 }
482 if (typeElement !== dynamicTypeElement) { 483 if (typeElement !== dynamicTypeElement) {
483 makeTypePlaceholder(target, type); 484 makeTypePlaceholder(target, type);
484 } else { 485 } else {
485 if (!isDynamicType(node)) makeUnresolvedPlaceholder(target); 486 if (!isDynamicType(node)) makeUnresolvedPlaceholder(target);
486 } 487 }
487 } 488 }
488 } 489 }
489 // Trying to differentiate new A.foo() and lib.A cases. In the latter case 490 // Trying to differentiate new A.foo() and lib.A cases. In the latter case
490 // we don't want to go deeper into typeName. 491 // we don't want to go deeper into typeName.
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
630 631
631 visitBlock(Block node) { 632 visitBlock(Block node) {
632 for (Node statement in node.statements.nodes) { 633 for (Node statement in node.statements.nodes) {
633 if (statement is VariableDefinitions) { 634 if (statement is VariableDefinitions) {
634 makeVarDeclarationTypePlaceholder(statement); 635 makeVarDeclarationTypePlaceholder(statement);
635 } 636 }
636 } 637 }
637 node.visitChildren(this); 638 node.visitChildren(this);
638 } 639 }
639 } 640 }
OLDNEW
« no previous file with comments | « no previous file | lib/compiler/implementation/js_backend/constant_system_javascript.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698