flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aha...@apache.org
Subject [04/47] git commit: [flex-asjs] [refs/heads/develop] - superGetter & superSetter
Date Wed, 08 Apr 2015 23:05:23 GMT
superGetter & superSetter


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

Branch: refs/heads/develop
Commit: f7f0f20ef0e4644efbf67fd01786a1744cff261b
Parents: 31e50c8
Author: Alex Harui <aharui@apache.org>
Authored: Tue Feb 17 14:54:34 2015 -0800
Committer: Alex Harui <aharui@apache.org>
Committed: Tue Feb 17 14:54:34 2015 -0800

----------------------------------------------------------------------
 .../src/org/apache/flex/utils/Language.js       | 31 ++++++++++++++++++++
 1 file changed, 31 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f7f0f20e/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 fb3e893..6558657 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/utils/Language.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/utils/Language.js
@@ -247,3 +247,34 @@ org_apache_flex_utils_Language.postdecrement = function(obj, prop) {
   obj[prop] = value + 1;
   return value;
 };
+
+
+/**
+ * superGetter calls the getter on the given class' superclass.
+ *
+ * @expose
+ * @param {Object} clazz The class.
+ * @param {Object} pThis The this pointer.
+ * @param {string} prop The name of the getter.
+ * @return {number}
+ */
+org_apache_flex_utils_Language.superGetter = function(clazz, pthis, prop) {
+  var superdesc = Object.getOwnPropertyDescriptor(clazz.superClass_, prop);
+  return superdesc.get.call(pthis);	
+};
+
+
+/**
+ * superSetter calls the setter on the given class' superclass.
+ *
+ * @expose
+ * @param {Object} clazz The class.
+ * @param {Object} pThis The this pointer.
+ * @param {string} prop The name of the getter.
+ * @param {Object} value The value.
+ * @return {number}
+ */
+org_apache_flex_utils_Language.superSetter = function(clazz, pthis, prop, value) {
+  var superdesc = Object.getOwnPropertyDescriptor(clazz.superClass_, prop);
+  return superdesc.set.apply(pthis, [value]);	
+};


Mime
View raw message