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

Unified Diff: runtime/vm/ast.h

Issue 10689083: Compile an instance setter call when a static getter is declared, but no field (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 6 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 | « no previous file | runtime/vm/ast.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/ast.h
===================================================================
--- runtime/vm/ast.h (revision 9375)
+++ runtime/vm/ast.h (working copy)
@@ -1291,9 +1291,11 @@
class StaticGetterNode : public AstNode {
public:
StaticGetterNode(intptr_t token_pos,
+ AstNode* receiver, // Null if called from static context.
const Class& cls,
const String& field_name)
: AstNode(token_pos),
+ receiver_(receiver),
cls_(cls),
field_name_(field_name) {
ASSERT(cls_.IsZoneHandle());
@@ -1301,6 +1303,10 @@
ASSERT(field_name_.IsSymbol());
}
+ // The receiver is required when transforming this StaticGetterNode issued in
+ // a non-static context to an InstanceSetterNode. This occurs when no field
+ // and no setter are declared.
+ AstNode* receiver() const { return receiver_; }
const Class& cls() const { return cls_; }
const String& field_name() const { return field_name_; }
@@ -1313,6 +1319,7 @@
DECLARE_COMMON_NODE_FUNCTIONS(StaticGetterNode);
private:
+ AstNode* receiver_;
const Class& cls_;
const String& field_name_;
« no previous file with comments | « no previous file | runtime/vm/ast.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698