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

Unified Diff: runtime/vm/parser.cc

Issue 8294013: Merge the 3 different closure nodes into a single node. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 9 years, 2 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
« runtime/vm/ast.h ('K') | « runtime/vm/code_generator_ia32.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/parser.cc
===================================================================
--- runtime/vm/parser.cc (revision 473)
+++ runtime/vm/parser.cc (working copy)
@@ -1123,9 +1123,7 @@
AstNode* receiver) {
Function& implicit_closure_function =
Function::ZoneHandle(func.ImplicitClosureFunction());
- if (receiver == NULL) {
- return new ImplicitStaticClosureNode(token_pos, implicit_closure_function);
- } else {
+ if (receiver != NULL) {
// If we create an implicit instance closure from inside a closure of a
// parameterized class, make sure that the receiver is captured as
// instantiator.
@@ -1135,10 +1133,8 @@
CaptureReceiver();
}
}
- return new ImplicitInstanceClosureNode(token_pos,
- implicit_closure_function,
- receiver);
}
+ return new ClosureNode(token_pos, implicit_closure_function, receiver, NULL);
}
@@ -3508,7 +3504,8 @@
// variables are not relevant for the compilation of the enclosing function.
// This pruning is done by omitting to hook the local scope in its parent
// scope in the constructor of LocalScope.
- AstNode* closure = new ClosureNode(ident_pos, function, statements->scope());
+ AstNode* closure =
+ new ClosureNode(ident_pos, function, NULL, statements->scope());
if (function_variable == NULL) {
ASSERT(is_literal);
« runtime/vm/ast.h ('K') | « runtime/vm/code_generator_ia32.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698