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

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

Issue 2359453002: Handle local functions in kernel_impact. (Closed)
Patch Set: Updated cf. comments. Created 4 years, 3 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/kernel/kernel_debug.dart ('k') | pkg/compiler/lib/src/resolution/members.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/kernel/kernel_visitor.dart
diff --git a/pkg/compiler/lib/src/kernel/kernel_visitor.dart b/pkg/compiler/lib/src/kernel/kernel_visitor.dart
index 26f3b3a01fba3760919e1a9c8c81d8464dfe8058..415483f4c371f9fc985d87784e52833e0b56c13a 100644
--- a/pkg/compiler/lib/src/kernel/kernel_visitor.dart
+++ b/pkg/compiler/lib/src/kernel/kernel_visitor.dart
@@ -1689,8 +1689,12 @@ class KernelVisitor extends Object
LocalFunctionElement localFunction, NodeList parameters, Node body, _) {
return withCurrentElement(localFunction, () {
ir.VariableDeclaration local = getLocal(localFunction)..isFinal = true;
- return new ir.FunctionDeclaration(
+ ir.FunctionDeclaration function = new ir.FunctionDeclaration(
local, buildFunctionNode(localFunction, body));
+ // Closures can escape their context and we must therefore store them
+ // globally to include them in the world computation.
+ kernel.localFunctions[localFunction] = function;
+ return function;
});
}
« no previous file with comments | « pkg/compiler/lib/src/kernel/kernel_debug.dart ('k') | pkg/compiler/lib/src/resolution/members.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698