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

Unified Diff: runtime/vm/ast.h

Issue 10849004: Fix super getter/setter (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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
« 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 10409)
+++ runtime/vm/ast.h (working copy)
@@ -1238,24 +1238,30 @@
class StaticGetterNode : public AstNode {
public:
StaticGetterNode(intptr_t token_pos,
- AstNode* receiver, // Null if called from static context.
+ AstNode* receiver,
+ bool is_super_getter,
const Class& cls,
const String& field_name)
: AstNode(token_pos),
receiver_(receiver),
cls_(cls),
- field_name_(field_name) {
+ field_name_(field_name),
+ is_super_getter_(is_super_getter) {
ASSERT(cls_.IsZoneHandle());
ASSERT(field_name_.IsZoneHandle());
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.
+ // The receiver is required
+ // 1) for a super getter (an instance method that is resolved at compile
+ // time rather than at runtime).
+ // 2) when transforming this StaticGetterNode issued in a non-static
+ // context to an InstanceSetterNode. This may occurs when we find a
+ // static getter, but no field and no static setter are declared.
AstNode* receiver() const { return receiver_; }
const Class& cls() const { return cls_; }
const String& field_name() const { return field_name_; }
+ bool is_super_getter() const { return is_super_getter_; }
virtual void VisitChildren(AstNodeVisitor* visitor) const { }
@@ -1269,6 +1275,7 @@
AstNode* receiver_;
const Class& cls_;
const String& field_name_;
+ const bool is_super_getter_;
DISALLOW_IMPLICIT_CONSTRUCTORS(StaticGetterNode);
};
@@ -1277,10 +1284,12 @@
class StaticSetterNode : public AstNode {
public:
StaticSetterNode(intptr_t token_pos,
+ AstNode* receiver,
const Class& cls,
const String& field_name,
AstNode* value)
: AstNode(token_pos),
+ receiver_(receiver),
cls_(cls),
field_name_(field_name),
value_(value) {
@@ -1289,6 +1298,9 @@
ASSERT(value_ != NULL);
}
+ // The receiver is required for a super setter (an instance method
+ // that is resolved at compile time rather than at runtime).
+ AstNode* receiver() const { return receiver_; }
const Class& cls() const { return cls_; }
const String& field_name() const { return field_name_; }
AstNode* value() const { return value_; }
@@ -1300,6 +1312,7 @@
DECLARE_COMMON_NODE_FUNCTIONS(StaticSetterNode);
private:
+ AstNode* receiver_;
const Class& cls_;
const String& field_name_;
AstNode* value_;
« 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