flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aha...@apache.org
Subject [17/22] git commit: [flex-asjs] [refs/heads/develop] - allow abstraction of 'in'
Date Fri, 09 Jan 2015 16:10:30 GMT
allow abstraction of 'in'


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

Branch: refs/heads/develop
Commit: c9f9b8a1578820557345d8f82901b7b316582a13
Parents: 9561c62
Author: Alex Harui <aharui@apache.org>
Authored: Fri Jan 9 07:47:05 2015 -0800
Committer: Alex Harui <aharui@apache.org>
Committed: Fri Jan 9 08:09:50 2015 -0800

----------------------------------------------------------------------
 .../src/org/apache/flex/core/DataBindingBase.js      | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/c9f9b8a1/frameworks/js/FlexJS/src/org/apache/flex/core/DataBindingBase.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/core/DataBindingBase.js b/frameworks/js/FlexJS/src/org/apache/flex/core/DataBindingBase.js
index 75313c3..6955b92 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/core/DataBindingBase.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/core/DataBindingBase.js
@@ -37,6 +37,21 @@ org.apache.flex.core.DataBindingBase.prototype.FLEXJS_CLASS_INFO =
  * @expose
  * @param {Object} obj The object.
  * @param {string} propName The name of the property.
+ * @return {boolean} True if property exists.
+ */
+org.apache.flex.core.DataBindingBase.prototype.hasProperty =
+    function(obj, propName) {
+  if (typeof obj['get_' + propName] === 'function') {
+    return true;
+  }
+  return (propName in obj);
+};
+
+
+/**
+ * @expose
+ * @param {Object} obj The object.
+ * @param {string} propName The name of the property.
  * @return {Object} value The value of the property.
  */
 org.apache.flex.core.DataBindingBase.prototype.getProperty =


Mime
View raw message