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

Unified Diff: runtime/vm/ast_transformer.cc

Issue 1090373006: Properly resolve top-level setters (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 years, 8 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: runtime/vm/ast_transformer.cc
===================================================================
--- runtime/vm/ast_transformer.cc (revision 45315)
+++ runtime/vm/ast_transformer.cc (working copy)
@@ -499,6 +499,7 @@
new_receiver,
node->cls(),
node->field_name());
+ new_getter->set_owner(node->owner());
LocalVariable* result = AddToPreambleNewTempVar(new_getter);
result_ = new(Z) LoadLocalNode(Scanner::kNoSourcePos, result);
}
@@ -510,12 +511,20 @@
new_receiver = Transform(new_receiver);
}
AstNode* new_value = Transform(node->value());
- LocalVariable* result = AddToPreambleNewTempVar(
- new(Z) StaticSetterNode(node->token_pos(),
- new_receiver,
- node->cls(),
- node->field_name(),
- new_value));
+ StaticSetterNode* new_setter =
+ node->function().IsNull()
+ ? new(Z) StaticSetterNode(node->token_pos(),
+ new_receiver,
+ node->cls(),
+ node->field_name(),
+ new_value)
regis 2015/04/21 17:30:30 Indent lines above.
hausner 2015/04/21 17:40:11 Done.
+ : new(Z) StaticSetterNode(node->token_pos(),
+ new_receiver,
+ node->field_name(),
+ node->function(),
+ new_value);
+
+ LocalVariable* result = AddToPreambleNewTempVar(new_setter);
result_ = new(Z) LoadLocalNode(Scanner::kNoSourcePos, result);
}
« runtime/vm/ast.cc ('K') | « runtime/vm/ast.cc ('k') | runtime/vm/flow_graph_builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698