flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From erikdebr...@apache.org
Subject [3/4] git commit: [flex-asjs] [refs/heads/develop] - Actual implementation of 'is()'.
Date Tue, 05 Nov 2013 12:44:58 GMT
Actual implementation of 'is()'.

Signed-off-by: Erik de Bruin <erik@ixsoftware.nl>


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

Branch: refs/heads/develop
Commit: f988da4e863e564717457e5b26e2b4e3b53b8d7d
Parents: 0046a40
Author: Erik de Bruin <erik@ixsoftware.nl>
Authored: Tue Nov 5 12:00:52 2013 +0100
Committer: Erik de Bruin <erik@ixsoftware.nl>
Committed: Tue Nov 5 12:05:51 2013 +0100

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


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f988da4e/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 2f2edeb..a4784ca 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/utils/Language.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/utils/Language.js
@@ -69,7 +69,30 @@ org.apache.flex.utils.Language._int = function(value) {
  * @return {boolean}
  */
 org.apache.flex.utils.Language.is = function(leftOperand, rightOperand) {
-	return true;
+	var checkInterfaces;
+	
+	checkInterfaces = function (left) {
+		var i, interfaces;
+	
+		interfaces = left.AFJS_INTERFACES;
+		for (i = interfaces.length - 1; i > -1; i--) {
+			if (interfaces[i] === rightOperand) {
+				return true;
+			} else if (interfaces[i].AFJS_INTERFACES) {
+				return checkInterfaces(interfaces[i]);
+			}
+		}
+	
+		return false;
+	}
+
+	if (leftOperand instanceof rightOperand) {
+		return true;
+	} else if (leftOperand.AFJS_INTERFACES) {
+		return checkInterfaces(leftOperand)
+	}
+
+	return false;
 };
 
 


Mime
View raw message