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

Unified Diff: frog/frogsh

Issue 8483005: better property overriding field (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 9 years, 1 month 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 | frog/member.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: frog/frogsh
diff --git a/frog/frogsh b/frog/frogsh
index 20b880abc4092a7be01d81d2858634191980d6dd..c226e5a9c3f88da7d72e5448aa5e5388929289f9 100755
--- a/frog/frogsh
+++ b/frog/frogsh
@@ -10944,6 +10944,7 @@ PropertyMember.prototype.override = function(other) {
if ($notnull_bool(!$notnull_bool(Member.prototype.override.call(this, other)))) return false;
if ($notnull_bool(other.get$isProperty() || other.get$isField())) {
if ($notnull_bool(other.get$isProperty())) this.addFromParent(other);
+ else this._overriddenField = other;
return true;
}
else {
@@ -10953,11 +10954,20 @@ PropertyMember.prototype.override = function(other) {
}
PropertyMember.prototype.get_ = function(context, node, target, isDynamic) {
if ($notnull_bool(this.getter == null)) {
+ if ($notnull_bool(this._overriddenField != null)) {
+ return this._overriddenField.get_(context, node, target, isDynamic);
+ }
return target.invokeNoSuchMethod(context, ('get:' + this.name + ''), node);
}
return this.getter.invoke(context, node, target, Arguments.get$EMPTY(), false);
}
PropertyMember.prototype.set_ = function(context, node, target, value, isDynamic) {
+ if ($notnull_bool(this.setter == null)) {
+ if ($notnull_bool(this._overriddenField != null)) {
+ return this._overriddenField.set_(context, node, target, value, isDynamic);
+ }
+ return target.invokeNoSuchMethod(context, ('set:' + this.name + ''), node, new Arguments(null, [value]));
+ }
return this.setter.invoke(context, node, target, new Arguments(null, [value]), isDynamic);
}
PropertyMember.prototype.addFromParent = function(parentMember) {
« no previous file with comments | « no previous file | frog/member.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698