moved files from todo/ to ok/ again
authorMatthias Kramm <kramm@quiss.org>
Sun, 8 Mar 2009 21:36:40 +0000 (22:36 +0100)
committerMatthias Kramm <kramm@quiss.org>
Sun, 8 Mar 2009 21:36:40 +0000 (22:36 +0100)
lib/as3/ok/import1.as [new file with mode: 0644]
lib/as3/ok/import2.as [new file with mode: 0644]
lib/as3/ok/packagestr.as [moved from lib/as3/todo/packagestr.as with 100% similarity]
lib/as3/ok/xml.as [moved from lib/as3/todo/xml.as with 100% similarity]
lib/as3/ok/xml_ns.as [moved from lib/as3/todo/xml_ns.as with 100% similarity]
lib/as3/todo/namespaces1.as [deleted file]

diff --git a/lib/as3/ok/import1.as b/lib/as3/ok/import1.as
new file mode 100644 (file)
index 0000000..754e206
--- /dev/null
@@ -0,0 +1,37 @@
+/* import1+import2: two files for testing pass 1 class import */
+
+package import1 {
+    import flash.display.MovieClip;
+    
+    public interface II1 {
+    }
+    public interface II2 {
+    }
+    public class CC1 implements II1 {
+    }
+    public class CC2 extends CC1 implements II2 {
+    }
+
+    import import2.I1
+    import import2.I2
+    import import2.C1
+    import import2.C2
+
+    public class Main extends flash.display.MovieClip {
+        public function Main() {
+            var x:C2 = new C2();
+            if(x is C1) trace("ok 1/8");
+            if(x is C2) trace("ok 2/8");
+            if(x is I1) trace("ok 3/8");
+            if(x is I2) trace("ok 4/8");
+            var a:I1 = x;
+            var b:I2 = x;
+            var c:C1 = x;
+            var d:C2 = x;
+            if(x === a) trace("ok 5/8");
+            if(x === b) trace("ok 6/8");
+            if(x === c) trace("ok 7/8");
+            if(x === d) trace("ok 8/8");
+        }
+    }
+}
diff --git a/lib/as3/ok/import2.as b/lib/as3/ok/import2.as
new file mode 100644 (file)
index 0000000..67d35ef
--- /dev/null
@@ -0,0 +1,35 @@
+package import2 {
+    import flash.display.MovieClip;
+    
+    public interface I1 {
+    }
+    public interface I2 {
+    }
+    public class C1 implements I1 {
+    }
+    public class C2 extends C1 implements I2 {
+    }
+    
+    import import2.II1
+    import import2.II2
+    import import2.CC1
+    import import2.CC2
+
+    public class Main extends flash.display.MovieClip {
+        public function Main() {
+            var x:CC2 = new CC2();
+            if(x is CC1) trace("ok 1/8");
+            if(x is CC2) trace("ok 2/8");
+            if(x is II1) trace("ok 3/8");
+            if(x is II2) trace("ok 4/8");
+            var a:II1 = x;
+            var b:II2 = x;
+            var c:CC1 = x;
+            var d:CC2 = x;
+            if(x === a) trace("ok 5/8");
+            if(x === b) trace("ok 6/8");
+            if(x === c) trace("ok 7/8");
+            if(x === d) trace("ok 8/8");
+        }
+    }
+}
similarity index 100%
rename from lib/as3/todo/xml.as
rename to lib/as3/ok/xml.as
similarity index 100%
rename from lib/as3/todo/xml_ns.as
rename to lib/as3/ok/xml_ns.as
diff --git a/lib/as3/todo/namespaces1.as b/lib/as3/todo/namespaces1.as
deleted file mode 100644 (file)
index aabad2d..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-package my.namespaces { 
-    public namespace ns1 = "http://www.some.other/namespace";
-    public namespace ns2 = "http://www.swftools.org/";
-    public namespace ns3 = "http://yet.some.other/namespace";
-    public namespace ns4 = "bla bla";
-
-    public class Test {
-
-        ns1 static function test() {
-            trace("error");
-        }
-        ns2 static function test() {
-            trace("ok 2/4");
-            use namespace my.namespaces.ns2;
-            (new Test()).test2()
-        }
-        ns3 static function test() {
-            trace("error");
-        }
-
-        ns1 function test2() {trace("error");}
-        ns2 function test2() {trace("ok 3/4");}
-        ns3 function test2() {trace("error");}
-
-        ns4 static function test3() {
-            trace("ok 4/4");
-        }
-    }
-}
-    
-package {
-
-    import flash.display.MovieClip
-    import flash.utils.Proxy
-    import flash.utils.flash_proxy
-
-    use namespace flash.utils.flash_proxy;
-    
-    public namespace ns4clone = "bla bla";
-    use namespace ns4clone;
-
-    public class Main extends flash.display.MovieClip {
-
-        use namespace my.namespaces.ns2;
-
-        private function test1() {
-            my.namespaces.Test.test()
-        }
-
-        public function Main() 
-        {
-            var p:Proxy = new Proxy
-            try {
-                p.hasProperty("test")
-            } catch(e:Error) {
-                // Proxy is similar to an interface, and will throw some kind
-                // of "class not implemented" exception
-                trace("ok 1/4");
-            }
-            my.namespaces.Test.test()
-
-            my.namespaces.Test.test3()
-            trace("[exit]");
-        }
-    }
-}
-