flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From erikdebr...@apache.org
Subject [3/9] git commit: [flex-asjs] [refs/heads/develop] - Added tests for super classes implementing interfaces
Date Fri, 15 Nov 2013 14:56:17 GMT
Added tests for super classes implementing interfaces

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/aa9eb9cd
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/aa9eb9cd
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/aa9eb9cd

Branch: refs/heads/develop
Commit: aa9eb9cdc62fef4f421a70d78fd8c852b7e4c117
Parents: 439b9e2
Author: Erik de Bruin <erik@ixsoftware.nl>
Authored: Fri Nov 15 10:32:34 2013 +0100
Committer: Erik de Bruin <erik@ixsoftware.nl>
Committed: Fri Nov 15 10:32:34 2013 +0100

----------------------------------------------------------------------
 examples/LanguageTests/src/LanguageTests.as | 30 ++++++++++++++++++++++--
 examples/LanguageTests/src/classes/B.as     |  2 +-
 examples/LanguageTests/src/classes/C.as     |  4 +++-
 examples/LanguageTests/src/interfaces/IF.as |  4 ++++
 4 files changed, 36 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/aa9eb9cd/examples/LanguageTests/src/LanguageTests.as
----------------------------------------------------------------------
diff --git a/examples/LanguageTests/src/LanguageTests.as b/examples/LanguageTests/src/LanguageTests.as
index 89b59f7..6e7e42f 100644
--- a/examples/LanguageTests/src/LanguageTests.as
+++ b/examples/LanguageTests/src/LanguageTests.as
@@ -18,10 +18,20 @@ public class LanguageTests extends Sprite implements IA, IE
 		var testResult:Boolean;
 		var testObject:Object;
 		
+		var b:B = new B();
+		
 		testResult = this instanceof Sprite;
 		trace('this instanceof Sprite - true: ' + testResult.toString());
 		testResult = this instanceof B;
 		trace('this instanceof classes.B - false: ' + testResult.toString());
+		testResult = b instanceof classes.B;
+		trace('b instanceof classes.B - true: ' + testResult.toString());
+		testResult = b instanceof classes.C;
+		trace('b instanceof classes.C - true: ' + testResult.toString());
+		testResult = b instanceof interfaces.IC;
+		trace('b instanceof interfaces.IC - false: ' + testResult.toString());
+		testResult = b instanceof interfaces.IF;
+		trace('b instanceof interfaces.IF - false: ' + testResult.toString());
 		testResult = this instanceof IA;
 		trace('this instanceof interfaces.IA - false: ' + testResult.toString());
 		testResult = this instanceof IB;
@@ -32,11 +42,19 @@ public class LanguageTests extends Sprite implements IA, IE
 		trace('this instanceof interfaces.ID - false: ' + testResult.toString());
 		testResult = this instanceof IE;
 		trace('this instanceof interfaces.IE - false: ' + testResult.toString());
-		
+		trace();
 		testResult = this is Sprite;
 		trace('this is Sprite - true: ' + testResult.toString());
 		testResult = this is B;
 		trace('this is classes.B - false: ' + testResult.toString());
+		testResult = b is classes.B;
+		trace('b is classes.B - true: ' + testResult.toString());
+		testResult = b is classes.C;
+		trace('b is classes.C - true: ' + testResult.toString());
+		testResult = b is interfaces.IC;
+		trace('b is interfaces.IC - false: ' + testResult.toString());
+		testResult = b is interfaces.IF;
+		trace('b is interfaces.IF - true: ' + testResult.toString());
 		testResult = this is IA;
 		trace('this is interfaces.IA - true: ' + testResult.toString());
 		testResult = this is IB;
@@ -47,11 +65,19 @@ public class LanguageTests extends Sprite implements IA, IE
 		trace('this is interfaces.ID - true: ' + testResult.toString());
 		testResult = this is IE;
 		trace('this is interfaces.IE - true: ' + testResult.toString());
-		
+		trace();
 		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 = (b as classes.B) ? b as classes.B : 'null';
+		trace('b as classes.B - [object ...]: ' + testObject.toString());
+		testObject = (b as classes.C) ? b as classes.C : 'null';
+		trace('b as classes.C - [object ...]: ' + testObject.toString());
+		testObject = (b as interfaces.IC) ? b as interfaces.IC : 'null';
+		trace('b as interfaces.IC - null: ' + testObject.toString());
+		testObject = (b as interfaces.IF) ? b as interfaces.IF : 'null';
+		trace('b as interfaces.IF - [object ...]: ' + 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';

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/aa9eb9cd/examples/LanguageTests/src/classes/B.as
----------------------------------------------------------------------
diff --git a/examples/LanguageTests/src/classes/B.as b/examples/LanguageTests/src/classes/B.as
index 8f5748a..bbc5c44 100644
--- a/examples/LanguageTests/src/classes/B.as
+++ b/examples/LanguageTests/src/classes/B.as
@@ -1,6 +1,6 @@
 package classes
 {
-    public class B
+    public class B extends C
     {
         public function B() {}
     }

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/aa9eb9cd/examples/LanguageTests/src/classes/C.as
----------------------------------------------------------------------
diff --git a/examples/LanguageTests/src/classes/C.as b/examples/LanguageTests/src/classes/C.as
index 953c9f1..90368fb 100644
--- a/examples/LanguageTests/src/classes/C.as
+++ b/examples/LanguageTests/src/classes/C.as
@@ -1,6 +1,8 @@
 package classes
 {
-    public class C
+	import interfaces.IF;
+
+    public class C implements IF
     {
         public function C() {}
     }

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


Mime
View raw message