| 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; |
| 11 | 11 |
| 12 String toString() => "ClosureFieldElement($name)"; | 12 String toString() => "ClosureFieldElement($name)"; |
| 13 } | 13 } |
| 14 | 14 |
| 15 class ClosureClassElement extends ClassElement { | 15 class ClosureClassElement extends ClassElement { |
| 16 ClosureClassElement(Compiler compiler, Element enclosingElement) | 16 ClosureClassElement(Compiler compiler, Element enclosingElement) |
| 17 : super(Compiler.CLOSURE, enclosingElement) { | 17 : super(compiler.closureClass.name, enclosingElement) { |
| 18 isResolved = true; | 18 isResolved = true; |
| 19 compiler.closureClass.ensureResolved(compiler); | 19 compiler.closureClass.ensureResolved(compiler); |
| 20 supertype = compiler.closureClass.computeType(compiler); | 20 supertype = compiler.closureClass.computeType(compiler); |
| 21 } | 21 } |
| 22 } | 22 } |
| 23 | 23 |
| 24 // The box-element for a scope, and the captured variables that need to be | 24 // The box-element for a scope, and the captured variables that need to be |
| 25 // stored in the box. | 25 // stored in the box. |
| 26 class ClosureScope { | 26 class ClosureScope { |
| 27 Element boxElement; | 27 Element boxElement; |
| (...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 410 declareLocal(elements[node]); | 410 declareLocal(elements[node]); |
| 411 } | 411 } |
| 412 | 412 |
| 413 visitTryStatement(TryStatement node) { | 413 visitTryStatement(TryStatement node) { |
| 414 // TODO(ngeoffray): implement finer grain state. | 414 // TODO(ngeoffray): implement finer grain state. |
| 415 inTryCatchOrFinally = true; | 415 inTryCatchOrFinally = true; |
| 416 node.visitChildren(this); | 416 node.visitChildren(this); |
| 417 inTryCatchOrFinally = false; | 417 inTryCatchOrFinally = false; |
| 418 } | 418 } |
| 419 } | 419 } |
| OLD | NEW |