| 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 'common.dart'; | 7 import 'common.dart'; |
| 8 import 'common/names.dart' show | 8 import 'common/names.dart' show |
| 9 Identifiers; | 9 Identifiers; |
| 10 import 'common/resolution.dart' show | 10 import 'common/resolution.dart' show |
| (...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 345 | 345 |
| 346 FunctionExpression get node => expression.node; | 346 FunctionExpression get node => expression.node; |
| 347 | 347 |
| 348 FunctionExpression parseNode(Parsing parsing) => node; | 348 FunctionExpression parseNode(Parsing parsing) => node; |
| 349 | 349 |
| 350 ResolvedAst get resolvedAst { | 350 ResolvedAst get resolvedAst { |
| 351 return new ResolvedAst(this, node, treeElements); | 351 return new ResolvedAst(this, node, treeElements); |
| 352 } | 352 } |
| 353 | 353 |
| 354 Element get analyzableElement => closureClass.methodElement.analyzableElement; | 354 Element get analyzableElement => closureClass.methodElement.analyzableElement; |
| 355 |
| 356 accept(ElementVisitor visitor, arg) { |
| 357 return visitor.visitMethodElement(this, arg); |
| 358 } |
| 355 } | 359 } |
| 356 | 360 |
| 357 // The box-element for a scope, and the captured variables that need to be | 361 // The box-element for a scope, and the captured variables that need to be |
| 358 // stored in the box. | 362 // stored in the box. |
| 359 class ClosureScope { | 363 class ClosureScope { |
| 360 final BoxLocal boxElement; | 364 final BoxLocal boxElement; |
| 361 final Map<Local, BoxFieldElement> capturedVariables; | 365 final Map<Local, BoxFieldElement> capturedVariables; |
| 362 | 366 |
| 363 // If the scope is attached to a [For] contains the variables that are | 367 // If the scope is attached to a [For] contains the variables that are |
| 364 // declared in the initializer of the [For] and that need to be boxed. | 368 // declared in the initializer of the [For] and that need to be boxed. |
| (...skipping 792 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1157 /// | 1161 /// |
| 1158 /// Move the below classes to a JS model eventually. | 1162 /// Move the below classes to a JS model eventually. |
| 1159 /// | 1163 /// |
| 1160 abstract class JSEntity implements Entity { | 1164 abstract class JSEntity implements Entity { |
| 1161 Entity get declaredEntity; | 1165 Entity get declaredEntity; |
| 1162 } | 1166 } |
| 1163 | 1167 |
| 1164 abstract class PrivatelyNamedJSEntity implements JSEntity { | 1168 abstract class PrivatelyNamedJSEntity implements JSEntity { |
| 1165 Entity get rootOfScope; | 1169 Entity get rootOfScope; |
| 1166 } | 1170 } |
| OLD | NEW |