| 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 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 307 } | 307 } |
| 308 | 308 |
| 309 void makeElementPlaceholder(Node node, Element element) { | 309 void makeElementPlaceholder(Node node, Element element) { |
| 310 assert(element != null); | 310 assert(element != null); |
| 311 if (identical(element, entryFunction)) return; | 311 if (identical(element, entryFunction)) return; |
| 312 if (identical(element.getLibrary(), coreLibrary)) return; | 312 if (identical(element.getLibrary(), coreLibrary)) return; |
| 313 if (element.getLibrary().isPlatformLibrary && !element.isTopLevel()) { | 313 if (element.getLibrary().isPlatformLibrary && !element.isTopLevel()) { |
| 314 return; | 314 return; |
| 315 } | 315 } |
| 316 if (element == compiler.dynamicClass) { | 316 if (element == compiler.dynamicClass) { |
| 317 return; | 317 internalError( |
| 318 'Should never make element placeholder for dynamic type element', |
| 319 node: node); |
| 318 } | 320 } |
| 319 elementNodes.putIfAbsent(element, () => new Set<Node>()).add(node); | 321 elementNodes.putIfAbsent(element, () => new Set<Node>()).add(node); |
| 320 } | 322 } |
| 321 | 323 |
| 322 void makePrivateIdentifier(Identifier node) { | 324 void makePrivateIdentifier(Identifier node) { |
| 323 assert(node != null); | 325 assert(node != null); |
| 324 privateNodes.putIfAbsent( | 326 privateNodes.putIfAbsent( |
| 325 currentElement.getLibrary(), () => new Set<Identifier>()).add(node); | 327 currentElement.getLibrary(), () => new Set<Identifier>()).add(node); |
| 326 } | 328 } |
| 327 | 329 |
| (...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 622 | 624 |
| 623 visitBlock(Block node) { | 625 visitBlock(Block node) { |
| 624 for (Node statement in node.statements.nodes) { | 626 for (Node statement in node.statements.nodes) { |
| 625 if (statement is VariableDefinitions) { | 627 if (statement is VariableDefinitions) { |
| 626 makeVarDeclarationTypePlaceholder(statement); | 628 makeVarDeclarationTypePlaceholder(statement); |
| 627 } | 629 } |
| 628 } | 630 } |
| 629 node.visitChildren(this); | 631 node.visitChildren(this); |
| 630 } | 632 } |
| 631 } | 633 } |
| OLD | NEW |