| 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 class ClosureFieldElement extends Element { | 5 class ClosureFieldElement extends Element { |
| 6 ClosureFieldElement(SourceString name, ClassElement enclosing) | 6 ClosureFieldElement(SourceString name, ClassElement enclosing) |
| 7 : super(name, ElementKind.FIELD, enclosing); | 7 : super(name, ElementKind.FIELD, enclosing); |
| 8 | 8 |
| 9 bool isInstanceMember() => true; | 9 bool isInstanceMember() => true; |
| 10 bool isAssignable() => false; | 10 bool isAssignable() => false; |
| (...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 248 node.visitChildren(this); | 248 node.visitChildren(this); |
| 249 } | 249 } |
| 250 | 250 |
| 251 visitSend(Send node) { | 251 visitSend(Send node) { |
| 252 Element element = elements[node]; | 252 Element element = elements[node]; |
| 253 if (Elements.isLocal(element)) { | 253 if (Elements.isLocal(element)) { |
| 254 useLocal(element); | 254 useLocal(element); |
| 255 } else if (node.receiver === null && | 255 } else if (node.receiver === null && |
| 256 Elements.isInstanceSend(node, elements)) { | 256 Elements.isInstanceSend(node, elements)) { |
| 257 useLocal(closureData.thisElement); | 257 useLocal(closureData.thisElement); |
| 258 } else if (node.isSuperCall) { |
| 259 useLocal(closureData.thisElement); |
| 258 } | 260 } |
| 259 node.visitChildren(this); | 261 node.visitChildren(this); |
| 260 } | 262 } |
| 261 | 263 |
| 262 // If variables that are declared in the [node] scope are captured and need | 264 // If variables that are declared in the [node] scope are captured and need |
| 263 // to be boxed create a box-element and update the [capturingScopes] in the | 265 // to be boxed create a box-element and update the [capturingScopes] in the |
| 264 // current [closureData]. | 266 // current [closureData]. |
| 265 // The boxed variables are updated in the [capturedVariableMapping]. | 267 // The boxed variables are updated in the [capturedVariableMapping]. |
| 266 void attachCapturedScopeVariables(Node node) { | 268 void attachCapturedScopeVariables(Node node) { |
| 267 Element box = null; | 269 Element box = null; |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 432 declareLocal(elements[node]); | 434 declareLocal(elements[node]); |
| 433 } | 435 } |
| 434 | 436 |
| 435 visitTryStatement(TryStatement node) { | 437 visitTryStatement(TryStatement node) { |
| 436 // TODO(ngeoffray): implement finer grain state. | 438 // TODO(ngeoffray): implement finer grain state. |
| 437 inTryCatchOrFinally = true; | 439 inTryCatchOrFinally = true; |
| 438 node.visitChildren(this); | 440 node.visitChildren(this); |
| 439 inTryCatchOrFinally = false; | 441 inTryCatchOrFinally = false; |
| 440 } | 442 } |
| 441 } | 443 } |
| OLD | NEW |