flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From erikdebr...@apache.org
Subject [1/4] git commit: [flex-asjs] [refs/heads/develop] - LanguageTests example.
Date Tue, 05 Nov 2013 12:44:56 GMT
Updated Branches:
  refs/heads/develop 0046a4017 -> ad7786071


LanguageTests example.

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/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 <erik@ixsoftware.nl>
Authored: Tue Nov 5 12:05:37 2013 +0100
Committer: Erik de Bruin <erik@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


Mime
View raw message