Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #252 from clinuz/master

Post-2.2 critical fix

Reviewed-By: Ben Combee (ben.combee@lge.com)
  • Loading branch information...
commit b2f05ea04260be83bacb3d2c911fe745fe2fd9e7 2 parents f42c7da + 72232ca
Ben Combee unwiredben authored
Showing with 23 additions and 0 deletions.
  1. +23 −0 source/kernel/Object.js
23 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,28 @@ 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 and setter.
+*/
+enyo.Object.overload = function (ctor, props) {
+ var proto = ctor.prototype.base? ctor.prototype.base.prototype: {};
+ var regex = /^(get|set).*/;
+ var name;
+ var prop;
+ for (name in props) {
+ if (!regex.test(name)) continue;
+ prop = props[name];
+ if ("function" === typeof prop) {
+ if (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
Please sign in to comment.
Something went wrong with that request. Please try again.