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

Unified Diff: pkg/compiler/lib/src/kernel/element_map.dart

Issue 2994363002: Fix the local variable lookup in the locals handler. (Closed)
Patch Set: . 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
Index: pkg/compiler/lib/src/kernel/element_map.dart
diff --git a/pkg/compiler/lib/src/kernel/element_map.dart b/pkg/compiler/lib/src/kernel/element_map.dart
index 9bad04ee9de5a80a1acafda382e328c4b7ed90de..f1fc72519504c4e22288173c50bd9ac565e9524e 100644
--- a/pkg/compiler/lib/src/kernel/element_map.dart
+++ b/pkg/compiler/lib/src/kernel/element_map.dart
@@ -383,8 +383,14 @@ abstract class KernelToLocalsMap {
/// Call to notify that [member] is no longer being inlined.
void leaveInlinedMember(covariant MemberEntity member);
- /// Returns the [Local] for [node].
- Local getLocalVariable(ir.VariableDeclaration node);
+ /// Returns the [Local] for [node]. If [isClosureCallMethod] is true, this
+ /// gives the locals map permission to also look one scope higher within the
+ /// class for the corresponding local. This can happen in the case of free
+ /// variables involved with a closure class.
+ // TODO(efortuna, johnniwinther): convey this information without a boolean
+ // parameter.
+ Local getLocalVariable(ir.VariableDeclaration node,
+ {bool isClosureCallMethod = false});
/// Returns the [Local] corresponding to the [node]. The node must be either
/// a [ir.FunctionDeclaration] or [ir.FunctionExpression].

Powered by Google App Engine
This is Rietveld 408576698