Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(71)

Unified Diff: pkg/compiler/lib/src/js_model/closure_visitors.dart

Issue 2994363002: Fix the local variable lookup in the locals handler. (Closed)
Patch Set: stephen comments Created 3 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/compiler/lib/src/js_model/closure.dart ('k') | pkg/compiler/lib/src/js_model/elements.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/js_model/closure_visitors.dart
diff --git a/pkg/compiler/lib/src/js_model/closure_visitors.dart b/pkg/compiler/lib/src/js_model/closure_visitors.dart
index b6e7d3ba64262a0af859bdbec9c9516ae3f06180..868466b15eb02e55f583de4240de82e24966d93a 100644
--- a/pkg/compiler/lib/src/js_model/closure_visitors.dart
+++ b/pkg/compiler/lib/src/js_model/closure_visitors.dart
@@ -70,7 +70,7 @@ class CapturedScopeBuilder extends ir.Visitor {
/// Update the [CapturedScope] object corresponding to
/// this node if any variables are captured.
- void attachCapturedScopeVariables(ir.Node node) {
+ void attachCapturedScopeVariables(ir.TreeNode node) {
Set<ir.VariableDeclaration> capturedVariablesForScope =
new Set<ir.VariableDeclaration>();
@@ -86,13 +86,14 @@ class CapturedScopeBuilder extends ir.Visitor {
assert(_model.scopeInfo != null);
assert(_currentLocalFunction != null);
KernelScopeInfo from = _model.scopeInfo;
- _scopesCapturedInClosureMap[node] = new KernelCapturedScope(
+ var capturedScope = new KernelCapturedScope(
capturedVariablesForScope,
new NodeBox(getBoxName(), _executableContext),
_currentLocalFunction,
from.localsUsedInTryOrSync,
from.freeVariables,
_hasThisLocal);
+ _model.scopeInfo = _scopesCapturedInClosureMap[node] = capturedScope;
}
}
@@ -236,8 +237,8 @@ class CapturedScopeBuilder extends ir.Visitor {
_currentLocalFunction = node.parent;
} else {
_outermostNode = node;
- _model.scopeInfo = _currentScopeInfo;
}
+ _model.scopeInfo = _currentScopeInfo;
enterNewScope(node, () {
node.visitChildren(this);
« no previous file with comments | « pkg/compiler/lib/src/js_model/closure.dart ('k') | pkg/compiler/lib/src/js_model/elements.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698