| 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 #library("closureToClassMapper"); | 5 #library("closureToClassMapper"); |
| 6 | 6 |
| 7 #import("elements/elements.dart"); | 7 #import("elements/elements.dart"); |
| 8 #import("leg.dart"); | 8 #import("leg.dart"); |
| 9 #import("scanner/scannerlib.dart"); | 9 #import("scanner/scannerlib.dart"); |
| 10 #import("tree/tree.dart"); | 10 #import("tree/tree.dart"); |
| (...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 305 for (Link<Node> link = node.definitions.nodes; | 305 for (Link<Node> link = node.definitions.nodes; |
| 306 !link.isEmpty(); | 306 !link.isEmpty(); |
| 307 link = link.tail) { | 307 link = link.tail) { |
| 308 Node definition = link.head; | 308 Node definition = link.head; |
| 309 Element element = elements[definition]; | 309 Element element = elements[definition]; |
| 310 assert(element !== null); | 310 assert(element !== null); |
| 311 declareLocal(element); | 311 declareLocal(element); |
| 312 // We still need to visit the right-hand sides of the init-assignments. | 312 // We still need to visit the right-hand sides of the init-assignments. |
| 313 // For SendSets don't visit the left again. Otherwise it would be marked | 313 // For SendSets don't visit the left again. Otherwise it would be marked |
| 314 // as mutated. | 314 // as mutated. |
| 315 if (definition is SendSet) { | 315 if (definition is Send) { |
| 316 SendSet assignment = definition; | 316 Send assignment = definition; |
| 317 visit(assignment.argumentsNode); | 317 Node arguments = assignment.argumentsNode; |
| 318 if (arguments != null) { |
| 319 visit(arguments); |
| 320 } |
| 318 } else { | 321 } else { |
| 319 visit(definition); | 322 visit(definition); |
| 320 } | 323 } |
| 321 } | 324 } |
| 322 } | 325 } |
| 323 | 326 |
| 324 visitIdentifier(Identifier node) { | 327 visitIdentifier(Identifier node) { |
| 325 if (node.isThis()) { | 328 if (node.isThis()) { |
| 326 useLocal(closureData.thisElement); | 329 useLocal(closureData.thisElement); |
| 327 } | 330 } |
| (...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 622 } | 625 } |
| 623 | 626 |
| 624 visitTryStatement(TryStatement node) { | 627 visitTryStatement(TryStatement node) { |
| 625 // TODO(ngeoffray): implement finer grain state. | 628 // TODO(ngeoffray): implement finer grain state. |
| 626 bool oldInTryStatement = inTryStatement; | 629 bool oldInTryStatement = inTryStatement; |
| 627 inTryStatement = true; | 630 inTryStatement = true; |
| 628 node.visitChildren(this); | 631 node.visitChildren(this); |
| 629 inTryStatement = oldInTryStatement; | 632 inTryStatement = oldInTryStatement; |
| 630 } | 633 } |
| 631 } | 634 } |
| OLD | NEW |