| 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 import 'common/names.dart' show Identifiers; | 5 import 'common/names.dart' show Identifiers; |
| 6 import 'common/resolution.dart' show ParsingContext, Resolution; | 6 import 'common/resolution.dart' show ParsingContext, Resolution; |
| 7 import 'common/tasks.dart' show CompilerTask, Measurer; | 7 import 'common/tasks.dart' show CompilerTask, Measurer; |
| 8 import 'common.dart'; | 8 import 'common.dart'; |
| 9 import 'compiler.dart' show Compiler; | 9 import 'compiler.dart' show Compiler; |
| 10 import 'constants/expressions.dart'; | 10 import 'constants/expressions.dart'; |
| (...skipping 1253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1264 | 1264 |
| 1265 for (LocalVariableElement variable in scopeVariables) { | 1265 for (LocalVariableElement variable in scopeVariables) { |
| 1266 // No need to box non-assignable elements. | 1266 // No need to box non-assignable elements. |
| 1267 if (!variable.isAssignable) continue; | 1267 if (!variable.isAssignable) continue; |
| 1268 if (!mutatedVariables.contains(variable)) continue; | 1268 if (!mutatedVariables.contains(variable)) continue; |
| 1269 boxCapturedVariable(variable); | 1269 boxCapturedVariable(variable); |
| 1270 } | 1270 } |
| 1271 if (!scopeMapping.isEmpty) { | 1271 if (!scopeMapping.isEmpty) { |
| 1272 CapturedScopeImpl scope = new CapturedScopeImpl(box, scopeMapping); | 1272 CapturedScopeImpl scope = new CapturedScopeImpl(box, scopeMapping); |
| 1273 closureData.capturingScopes[node] = scope; | 1273 closureData.capturingScopes[node] = scope; |
| 1274 print('adding capturing scope for $node to $closureData'); |
| 1274 assert(closureInfo[node] == null); | 1275 assert(closureInfo[node] == null); |
| 1275 closureInfo[node] = scope; | 1276 closureInfo[node] = scope; |
| 1276 } | 1277 } |
| 1277 } | 1278 } |
| 1278 | 1279 |
| 1279 void inNewScope(Node node, Function action) { | 1280 void inNewScope(Node node, Function action) { |
| 1280 List<LocalVariableElement> oldScopeVariables = scopeVariables; | 1281 List<LocalVariableElement> oldScopeVariables = scopeVariables; |
| 1281 scopeVariables = <LocalVariableElement>[]; | 1282 scopeVariables = <LocalVariableElement>[]; |
| 1282 action(); | 1283 action(); |
| 1283 attachCapturedScopeVariables(node); | 1284 attachCapturedScopeVariables(node); |
| (...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1547 /// | 1548 /// |
| 1548 /// Move the below classes to a JS model eventually. | 1549 /// Move the below classes to a JS model eventually. |
| 1549 /// | 1550 /// |
| 1550 abstract class JSEntity implements MemberEntity { | 1551 abstract class JSEntity implements MemberEntity { |
| 1551 Local get declaredEntity; | 1552 Local get declaredEntity; |
| 1552 } | 1553 } |
| 1553 | 1554 |
| 1554 abstract class PrivatelyNamedJSEntity implements JSEntity { | 1555 abstract class PrivatelyNamedJSEntity implements JSEntity { |
| 1555 Entity get rootOfScope; | 1556 Entity get rootOfScope; |
| 1556 } | 1557 } |
| OLD | NEW |