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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 // We assign twice to [supertypeLoadState] as it contains asserts | 70 // We assign twice to [supertypeLoadState] as it contains asserts |
71 // which enforce certain sequence of transitions. | 71 // which enforce certain sequence of transitions. |
72 supertypeLoadState = ClassElement.STATE_STARTED; | 72 supertypeLoadState = ClassElement.STATE_STARTED; |
73 supertypeLoadState = ClassElement.STATE_DONE; | 73 supertypeLoadState = ClassElement.STATE_DONE; |
74 // Same as for [supertypeLoadState] above. | 74 // Same as for [supertypeLoadState] above. |
75 resolutionState = ClassElement.STATE_STARTED; | 75 resolutionState = ClassElement.STATE_STARTED; |
76 resolutionState = ClassElement.STATE_DONE; | 76 resolutionState = ClassElement.STATE_DONE; |
77 compiler.closureClass.ensureResolved(compiler); | 77 compiler.closureClass.ensureResolved(compiler); |
78 supertype = compiler.closureClass.computeType(compiler); | 78 supertype = compiler.closureClass.computeType(compiler); |
79 interfaces = const EmptyLink<Type>(); | 79 interfaces = const EmptyLink<Type>(); |
| 80 allSupertypes = new Link<Type>(supertype); |
80 } | 81 } |
81 bool isClosure() => true; | 82 bool isClosure() => true; |
82 } | 83 } |
83 | 84 |
84 class BoxElement extends Element { | 85 class BoxElement extends Element { |
85 BoxElement(SourceString name, Element enclosingElement) | 86 BoxElement(SourceString name, Element enclosingElement) |
86 : super(name, ElementKind.VARIABLE, enclosingElement); | 87 : super(name, ElementKind.VARIABLE, enclosingElement); |
87 } | 88 } |
88 | 89 |
89 class ThisElement extends Element { | 90 class ThisElement extends Element { |
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
504 } | 505 } |
505 | 506 |
506 visitTryStatement(TryStatement node) { | 507 visitTryStatement(TryStatement node) { |
507 // TODO(ngeoffray): implement finer grain state. | 508 // TODO(ngeoffray): implement finer grain state. |
508 bool oldInTryStatement = inTryStatement; | 509 bool oldInTryStatement = inTryStatement; |
509 inTryStatement = true; | 510 inTryStatement = true; |
510 node.visitChildren(this); | 511 node.visitChildren(this); |
511 inTryStatement = oldInTryStatement; | 512 inTryStatement = oldInTryStatement; |
512 } | 513 } |
513 } | 514 } |
OLD | NEW |