You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by er...@apache.org on 2013/11/05 13:44:56 UTC

[1/4] git commit: [flex-asjs] [refs/heads/develop] - LanguageTests example.

Updated Branches:
  refs/heads/develop 0046a4017 -> ad7786071


LanguageTests example.

Signed-off-by: Erik de Bruin <er...@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/63b5f7f4
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/63b5f7f4
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/63b5f7f4

Branch: refs/heads/develop
Commit: 63b5f7f4d8860d0f7afaf28c6817020329aa548f
Parents: c8f10c6
Author: Erik de Bruin <er...@ixsoftware.nl>
Authored: Tue Nov 5 12:05:37 2013 +0100
Committer: Erik de Bruin <er...@ixsoftware.nl>
Committed: Tue Nov 5 12:05:51 2013 +0100

----------------------------------------------------------------------
 examples/LanguageTests/src/LanguageTests.as | 67 ++++++++++++++++++++++++
 examples/LanguageTests/src/classes/B.as     |  7 +++
 examples/LanguageTests/src/classes/C.as     |  7 +++
 examples/LanguageTests/src/interfaces/IA.as |  4 ++
 examples/LanguageTests/src/interfaces/IB.as |  4 ++
 examples/LanguageTests/src/interfaces/IC.as |  4 ++
 examples/LanguageTests/src/interfaces/ID.as |  4 ++
 examples/LanguageTests/src/interfaces/IE.as |  4 ++
 8 files changed, 101 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/63b5f7f4/examples/LanguageTests/src/LanguageTests.as
----------------------------------------------------------------------
diff --git a/examples/LanguageTests/src/LanguageTests.as b/examples/LanguageTests/src/LanguageTests.as
new file mode 100644
index 0000000..89b59f7
--- /dev/null
+++ b/examples/LanguageTests/src/LanguageTests.as
@@ -0,0 +1,67 @@
+package
+{
+
+import flash.display.Sprite;
+
+import classes.B;
+
+import interfaces.IA;
+import interfaces.IB;
+import interfaces.IC;
+import interfaces.ID;
+import interfaces.IE;
+
+public class LanguageTests extends Sprite implements IA, IE
+{
+	public function LanguageTests()
+	{
+		var testResult:Boolean;
+		var testObject:Object;
+		
+		testResult = this instanceof Sprite;
+		trace('this instanceof Sprite - true: ' + testResult.toString());
+		testResult = this instanceof B;
+		trace('this instanceof classes.B - false: ' + testResult.toString());
+		testResult = this instanceof IA;
+		trace('this instanceof interfaces.IA - false: ' + testResult.toString());
+		testResult = this instanceof IB;
+		trace('this instanceof interfaces.IB - false: ' + testResult.toString());
+		testResult = this instanceof IC;
+		trace('this instanceof interfaces.IC - false: ' + testResult.toString());
+		testResult = this instanceof ID;
+		trace('this instanceof interfaces.ID - false: ' + testResult.toString());
+		testResult = this instanceof IE;
+		trace('this instanceof interfaces.IE - false: ' + testResult.toString());
+		
+		testResult = this is Sprite;
+		trace('this is Sprite - true: ' + testResult.toString());
+		testResult = this is B;
+		trace('this is classes.B - false: ' + testResult.toString());
+		testResult = this is IA;
+		trace('this is interfaces.IA - true: ' + testResult.toString());
+		testResult = this is IB;
+		trace('this is interfaces.IB - false: ' + testResult.toString());
+		testResult = this is IC;
+		trace('this is interfaces.IC - true: ' + testResult.toString());
+		testResult = this is ID;
+		trace('this is interfaces.ID - true: ' + testResult.toString());
+		testResult = this is IE;
+		trace('this is interfaces.IE - true: ' + testResult.toString());
+		
+		testObject = (this as Sprite) ? this as Sprite : 'null';
+		trace('this as Sprite - [object ...]: ' + testObject.toString());
+		testObject = (this as B) ? this as B : 'null';
+		trace('this as classes.B - null: ' + testObject.toString());
+		testObject = (this as IA) ? this as IA : 'null';
+		trace('this as interfaces.IA - [object ...]: ' + testObject.toString());
+		testObject = (this as IB) ? this as IB : 'null';
+		trace('this as interfaces.IB - null: ' + testObject.toString());
+		testObject = (this as IC) ? this as IC : 'null';
+		trace('this as interfaces.IC - [object ...]: ' + testObject.toString());
+		testObject = (this as ID) ? this as ID : 'null';
+		trace('this as interfaces.ID - [object ...]: ' + testObject.toString());
+		testObject = (this as IE) ? this as IE : 'null';
+		trace('this as interfaces.IE - [object ...]: ' + testObject.toString());
+	}
+}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/63b5f7f4/examples/LanguageTests/src/classes/B.as
----------------------------------------------------------------------
diff --git a/examples/LanguageTests/src/classes/B.as b/examples/LanguageTests/src/classes/B.as
new file mode 100644
index 0000000..8f5748a
--- /dev/null
+++ b/examples/LanguageTests/src/classes/B.as
@@ -0,0 +1,7 @@
+package classes
+{
+    public class B
+    {
+        public function B() {}
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/63b5f7f4/examples/LanguageTests/src/classes/C.as
----------------------------------------------------------------------
diff --git a/examples/LanguageTests/src/classes/C.as b/examples/LanguageTests/src/classes/C.as
new file mode 100644
index 0000000..953c9f1
--- /dev/null
+++ b/examples/LanguageTests/src/classes/C.as
@@ -0,0 +1,7 @@
+package classes
+{
+    public class C
+    {
+        public function C() {}
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/63b5f7f4/examples/LanguageTests/src/interfaces/IA.as
----------------------------------------------------------------------
diff --git a/examples/LanguageTests/src/interfaces/IA.as b/examples/LanguageTests/src/interfaces/IA.as
new file mode 100644
index 0000000..b288321
--- /dev/null
+++ b/examples/LanguageTests/src/interfaces/IA.as
@@ -0,0 +1,4 @@
+package interfaces
+{
+  public interface IA extends IC {}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/63b5f7f4/examples/LanguageTests/src/interfaces/IB.as
----------------------------------------------------------------------
diff --git a/examples/LanguageTests/src/interfaces/IB.as b/examples/LanguageTests/src/interfaces/IB.as
new file mode 100644
index 0000000..b6f8925
--- /dev/null
+++ b/examples/LanguageTests/src/interfaces/IB.as
@@ -0,0 +1,4 @@
+package interfaces
+{
+    public interface IB {}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/63b5f7f4/examples/LanguageTests/src/interfaces/IC.as
----------------------------------------------------------------------
diff --git a/examples/LanguageTests/src/interfaces/IC.as b/examples/LanguageTests/src/interfaces/IC.as
new file mode 100644
index 0000000..9fcdd56
--- /dev/null
+++ b/examples/LanguageTests/src/interfaces/IC.as
@@ -0,0 +1,4 @@
+package interfaces
+{
+  public interface IC extends ID {}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/63b5f7f4/examples/LanguageTests/src/interfaces/ID.as
----------------------------------------------------------------------
diff --git a/examples/LanguageTests/src/interfaces/ID.as b/examples/LanguageTests/src/interfaces/ID.as
new file mode 100644
index 0000000..1bae05b
--- /dev/null
+++ b/examples/LanguageTests/src/interfaces/ID.as
@@ -0,0 +1,4 @@
+package interfaces
+{
+    public interface ID {}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/63b5f7f4/examples/LanguageTests/src/interfaces/IE.as
----------------------------------------------------------------------
diff --git a/examples/LanguageTests/src/interfaces/IE.as b/examples/LanguageTests/src/interfaces/IE.as
new file mode 100644
index 0000000..b40e49e
--- /dev/null
+++ b/examples/LanguageTests/src/interfaces/IE.as
@@ -0,0 +1,4 @@
+package interfaces
+{
+    public interface IE {}
+}
\ No newline at end of file


[3/4] git commit: [flex-asjs] [refs/heads/develop] - Actual implementation of 'is()'.

Posted by er...@apache.org.
Actual implementation of 'is()'.

Signed-off-by: Erik de Bruin <er...@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 <er...@ixsoftware.nl>
Authored: Tue Nov 5 12:00:52 2013 +0100
Committer: Erik de Bruin <er...@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;
 };
 
 


[4/4] git commit: [flex-asjs] [refs/heads/develop] - If the 'interfaces' array is implemented as a class constant, the Closure Compiler (release mode) "optimises" it to a global variable, thereby making it unreachable with a class member access. When ins

Posted by er...@apache.org.
If the 'interfaces' array is implemented as a class constant, the Closure Compiler (release mode) "optimises" it to a global variable, thereby making it unreachable with a class member access. When instead using a class member for storage, and using an instance for access, the code is no longer optimised into oblivion.

Signed-off-by: Erik de Bruin <er...@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/ad778607
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/ad778607
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/ad778607

Branch: refs/heads/develop
Commit: ad7786071f4f501e8906541701c59d09285dec07
Parents: 63b5f7f
Author: Erik de Bruin <er...@ixsoftware.nl>
Authored: Tue Nov 5 13:40:47 2013 +0100
Committer: Erik de Bruin <er...@ixsoftware.nl>
Committed: Tue Nov 5 13:40:47 2013 +0100

----------------------------------------------------------------------
 frameworks/js/FlexJS/src/org/apache/flex/utils/Language.js | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/ad778607/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 a4784ca..e9f919f 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/utils/Language.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/utils/Language.js
@@ -78,8 +78,10 @@ org.apache.flex.utils.Language.is = function(leftOperand, rightOperand) {
 		for (i = interfaces.length - 1; i > -1; i--) {
 			if (interfaces[i] === rightOperand) {
 				return true;
-			} else if (interfaces[i].AFJS_INTERFACES) {
-				return checkInterfaces(interfaces[i]);
+			} 
+			
+			if (interfaces[i].prototype.AFJS_INTERFACES) {
+				return checkInterfaces(new interfaces[i]());
 			}
 		}
 	
@@ -89,7 +91,7 @@ org.apache.flex.utils.Language.is = function(leftOperand, rightOperand) {
 	if (leftOperand instanceof rightOperand) {
 		return true;
 	} else if (leftOperand.AFJS_INTERFACES) {
-		return checkInterfaces(leftOperand)
+		return checkInterfaces(leftOperand);
 	}
 
 	return false;


[2/4] git commit: [flex-asjs] [refs/heads/develop] - This allows pure Actionscript projects to be compiled using FalconJx. It's kinda like the 'Application.js', but different ; -)

Posted by er...@apache.org.
This allows pure Actionscript projects to be compiled using FalconJx. It's kinda like the 'Application.js', but different ;-)

Signed-off-by: Erik de Bruin <er...@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/c8f10c61
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/c8f10c61
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/c8f10c61

Branch: refs/heads/develop
Commit: c8f10c61e5c544069b361dbf6f733b43fcd8b831
Parents: f988da4
Author: Erik de Bruin <er...@ixsoftware.nl>
Authored: Tue Nov 5 12:03:51 2013 +0100
Committer: Erik de Bruin <er...@ixsoftware.nl>
Committed: Tue Nov 5 12:05:51 2013 +0100

----------------------------------------------------------------------
 .../js/FlexJS/src/flash/display/Sprite.js       | 31 ++++++++++++++++++++
 1 file changed, 31 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/c8f10c61/frameworks/js/FlexJS/src/flash/display/Sprite.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/flash/display/Sprite.js b/frameworks/js/FlexJS/src/flash/display/Sprite.js
new file mode 100644
index 0000000..685a13a
--- /dev/null
+++ b/frameworks/js/FlexJS/src/flash/display/Sprite.js
@@ -0,0 +1,31 @@
+/**
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+goog.provide('flash.display.Sprite');
+
+
+
+/**
+ * @constructor
+ */
+flash.display.Sprite = function() {
+};
+
+
+/**
+ * @expose
+ * @this {flash.display.Sprite}
+ */
+flash.display.Sprite.prototype.start = function() {
+};