flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aha...@apache.org
Subject [26/47] git commit: [flex-asjs] [refs/heads/develop] - need to keep looking up ancestor chain for superSetter or superGetter
Date Wed, 08 Apr 2015 23:05:45 GMT
need to keep looking up ancestor chain for superSetter or superGetter


Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/cac36ed6
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/cac36ed6
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/cac36ed6

Branch: refs/heads/develop
Commit: cac36ed6a10e259dd20a82b5beaf2e675b475de0
Parents: ef847bf
Author: Alex Harui <aharui@apache.org>
Authored: Fri Apr 3 16:02:23 2015 -0700
Committer: Alex Harui <aharui@apache.org>
Committed: Fri Apr 3 16:02:23 2015 -0700

----------------------------------------------------------------------
 .../js/FlexJS/src/org/apache/flex/utils/Language.js | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/cac36ed6/frameworks/js/FlexJS/src/org/apache/flex/utils/Language.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/utils/Language.js b/frameworks/js/FlexJS/src/org/apache/flex/utils/Language.js
index ccbcace..3fdb371 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/utils/Language.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/utils/Language.js
@@ -259,7 +259,13 @@ org_apache_flex_utils_Language.postdecrement = function(obj, prop) {
  * @return {Object}
  */
 org_apache_flex_utils_Language.superGetter = function(clazz, pthis, prop) {
-  var superdesc = Object.getOwnPropertyDescriptor(clazz.superClass_, prop);
+  var superClass = clazz.superClass_;
+  var superdesc = Object.getOwnPropertyDescriptor(superClass, prop);
+  while (superdesc == null)
+  {
+    superClass = superClass.constructor.superClass_;
+    superdesc = Object.getOwnPropertyDescriptor(superClass, prop);
+  }
   return superdesc.get.call(pthis);
 };
 
@@ -274,6 +280,12 @@ org_apache_flex_utils_Language.superGetter = function(clazz, pthis, prop)
{
  * @param {Object} value The value.
  */
 org_apache_flex_utils_Language.superSetter = function(clazz, pthis, prop, value) {
-  var superdesc = Object.getOwnPropertyDescriptor(clazz.superClass_, prop);
+  var superClass = clazz.superClass_;
+  var superdesc = Object.getOwnPropertyDescriptor(superClass, prop);
+  while (superdesc == null)
+  {
+    superClass = superClass.constructor.superClass_;
+    superdesc = Object.getOwnPropertyDescriptor(superClass, prop);
+  }
   superdesc.set.apply(pthis, [value]);
 };


Mime
View raw message