| 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.closureClass.name, enclosingElement) { | 17 : super(compiler.closureClass.name, |
| 18 enclosingElement, |
| 19 // By assigning a fresh class-id we make sure that the hashcode |
| 20 // is unique, but also emit closure class after all other |
| 21 // classes (since the emitter sorts classes by their id). |
| 22 compiler.universe.getNextFreeClassId()) { |
| 18 isResolved = true; | 23 isResolved = true; |
| 19 compiler.closureClass.ensureResolved(compiler); | 24 compiler.closureClass.ensureResolved(compiler); |
| 20 supertype = compiler.closureClass.computeType(compiler); | 25 supertype = compiler.closureClass.computeType(compiler); |
| 21 } | 26 } |
| 22 } | 27 } |
| 23 | 28 |
| 24 class BoxElement extends Element { | 29 class BoxElement extends Element { |
| 25 BoxElement(SourceString name, Element enclosingElement) | 30 BoxElement(SourceString name, Element enclosingElement) |
| 26 : super(name, ElementKind.VARIABLE, enclosingElement); | 31 : super(name, ElementKind.VARIABLE, enclosingElement); |
| 27 } | 32 } |
| (...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 424 declareLocal(elements[node]); | 429 declareLocal(elements[node]); |
| 425 } | 430 } |
| 426 | 431 |
| 427 visitTryStatement(TryStatement node) { | 432 visitTryStatement(TryStatement node) { |
| 428 // TODO(ngeoffray): implement finer grain state. | 433 // TODO(ngeoffray): implement finer grain state. |
| 429 inTryCatchOrFinally = true; | 434 inTryCatchOrFinally = true; |
| 430 node.visitChildren(this); | 435 node.visitChildren(this); |
| 431 inTryCatchOrFinally = false; | 436 inTryCatchOrFinally = false; |
| 432 } | 437 } |
| 433 } | 438 } |
| OLD | NEW |