| 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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 Element enclosingElement) | 63 Element enclosingElement) |
| 64 : super(name, | 64 : super(name, |
| 65 enclosingElement, | 65 enclosingElement, |
| 66 // By assigning a fresh class-id we make sure that the hashcode | 66 // By assigning a fresh class-id we make sure that the hashcode |
| 67 // is unique, but also emit closure classes after all other | 67 // is unique, but also emit closure classes after all other |
| 68 // classes (since the emitter sorts classes by their id). | 68 // classes (since the emitter sorts classes by their id). |
| 69 compiler.getNextFreeClassId(), | 69 compiler.getNextFreeClassId(), |
| 70 STATE_DONE) { | 70 STATE_DONE) { |
| 71 compiler.closureClass.ensureResolved(compiler); | 71 compiler.closureClass.ensureResolved(compiler); |
| 72 supertype = compiler.closureClass.computeType(compiler); | 72 supertype = compiler.closureClass.computeType(compiler); |
| 73 interfaces = const EmptyLink<Type>(); | 73 interfaces = const EmptyLink<DartType>(); |
| 74 allSupertypes = new Link<Type>(supertype); | 74 allSupertypes = new Link<DartType>(supertype); |
| 75 } | 75 } |
| 76 bool isClosure() => true; | 76 bool isClosure() => true; |
| 77 } | 77 } |
| 78 | 78 |
| 79 class BoxElement extends Element { | 79 class BoxElement extends Element { |
| 80 BoxElement(SourceString name, Element enclosingElement) | 80 BoxElement(SourceString name, Element enclosingElement) |
| 81 : super(name, ElementKind.VARIABLE, enclosingElement); | 81 : super(name, ElementKind.VARIABLE, enclosingElement); |
| 82 } | 82 } |
| 83 | 83 |
| 84 class ThisElement extends Element { | 84 class ThisElement extends Element { |
| (...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 499 } | 499 } |
| 500 | 500 |
| 501 visitTryStatement(TryStatement node) { | 501 visitTryStatement(TryStatement node) { |
| 502 // TODO(ngeoffray): implement finer grain state. | 502 // TODO(ngeoffray): implement finer grain state. |
| 503 bool oldInTryStatement = inTryStatement; | 503 bool oldInTryStatement = inTryStatement; |
| 504 inTryStatement = true; | 504 inTryStatement = true; |
| 505 node.visitChildren(this); | 505 node.visitChildren(this); |
| 506 inTryStatement = oldInTryStatement; | 506 inTryStatement = oldInTryStatement; |
| 507 } | 507 } |
| 508 } | 508 } |
| OLD | NEW |