| 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 part of dart_backend; | 5 part of dart_backend; |
| 6 | 6 |
| 7 class LocalPlaceholder { | 7 class LocalPlaceholder { |
| 8 final String identifier; | 8 final String identifier; |
| 9 final Set<Node> nodes; | 9 final Set<Node> nodes; |
| 10 LocalPlaceholder(this.identifier) : nodes = new Set<Node>(); | 10 LocalPlaceholder(this.identifier) : nodes = new Set<Node>(); |
| (...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 373 } | 373 } |
| 374 elementNodes.putIfAbsent(element, () => new Set<Node>()).add(node); | 374 elementNodes.putIfAbsent(element, () => new Set<Node>()).add(node); |
| 375 } | 375 } |
| 376 | 376 |
| 377 /// Marks [node] to be renamed per-library if it names an instance member | 377 /// Marks [node] to be renamed per-library if it names an instance member |
| 378 /// and has a private name. | 378 /// and has a private name. |
| 379 void tryMakePrivateIdentifier(Node node, Element element) { | 379 void tryMakePrivateIdentifier(Node node, Element element) { |
| 380 if (node is Identifier && | 380 if (node is Identifier && |
| 381 !Elements.isStaticOrTopLevel(element) && | 381 !Elements.isStaticOrTopLevel(element) && |
| 382 !Elements.isLocal(element) && | 382 !Elements.isLocal(element) && |
| 383 isPrivateName(node.source)) { | 383 Name.isPrivateName(node.source)) { |
| 384 privateNodes.putIfAbsent( | 384 privateNodes.putIfAbsent( |
| 385 currentElement.library, () => new Set<Identifier>()).add(node); | 385 currentElement.library, () => new Set<Identifier>()).add(node); |
| 386 } | 386 } |
| 387 } | 387 } |
| 388 | 388 |
| 389 void makeUnresolvedPlaceholder(Node node) { | 389 void makeUnresolvedPlaceholder(Node node) { |
| 390 unresolvedNodes.add(node); | 390 unresolvedNodes.add(node); |
| 391 } | 391 } |
| 392 | 392 |
| 393 void makeLocalPlaceholder(Identifier identifier) { | 393 void makeLocalPlaceholder(Identifier identifier) { |
| (...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 717 | 717 |
| 718 visitBlock(Block node) { | 718 visitBlock(Block node) { |
| 719 for (Node statement in node.statements.nodes) { | 719 for (Node statement in node.statements.nodes) { |
| 720 if (statement is VariableDefinitions) { | 720 if (statement is VariableDefinitions) { |
| 721 makeVarDeclarationTypePlaceholder(statement); | 721 makeVarDeclarationTypePlaceholder(statement); |
| 722 } | 722 } |
| 723 } | 723 } |
| 724 node.visitChildren(this); | 724 node.visitChildren(this); |
| 725 } | 725 } |
| 726 } | 726 } |
| OLD | NEW |