Permalink
Browse files

critical fix for flagging overloaded getter methods originally based …

…on a published property of a parent kind

Enyo-DCO-1.1-Signed-off-by: Cole Davis <cole.davis@lge.com>
  • Loading branch information...
1 parent cba4297 commit 5bec16cfb4d87a76e7689641928b2c421265ab5a @clinuz clinuz committed Mar 27, 2013
Showing with 24 additions and 0 deletions.
  1. +24 −0 source/kernel/Object.js
View
@@ -163,6 +163,7 @@ enyo._objectCount = 0;
enyo.Object.subclass = function(ctor, props) {
this.publish(ctor, props);
+ this.overload(ctor, props);
};
enyo.Object.publish = function(ctor, props) {
@@ -180,6 +181,29 @@ enyo.Object.publish = function(ctor, props) {
//*@protected
/**
+ We need to find special cases and ensure that the overloaded
+ getter of a published property of a parent kind is flagged for
+ the global getter.
+*/
+enyo.Object.overload = function (ctor, props) {
+ var proto = ctor.prototype.base? ctor.prototype.base.prototype: {};
+ var regex = /(get|set).*/;
+ var name;
+ var prop;
+ var base;
+ for (name in props) {
+ if (!regex.test(name)) continue;
+ prop = props[name];
+ if ("function" === typeof prop) {
+ if ((base = proto[name])) {
+ prop.overloaded = true;
+ }
+ }
+ }
+};
+
+//*@protected
+/**
This method creates a getter/setter for a published property of
an _enyo.Object_ but is deprecated. It is maintained for backwards
compatability purposes. The prefered method is to mark public and

0 comments on commit 5bec16c

Please sign in to comment.