added more tests
authorMatthias Kramm <kramm@quiss.org>
Sat, 14 Mar 2009 19:59:21 +0000 (20:59 +0100)
committerMatthias Kramm <kramm@quiss.org>
Sat, 14 Mar 2009 19:59:21 +0000 (20:59 +0100)
lib/as3/ok/compareseq.as [new file with mode: 0644]
lib/as3/ok/extendclass.as [new file with mode: 0644]
lib/as3/ok/innerfunctionslots.as [new file with mode: 0644]

diff --git a/lib/as3/ok/compareseq.as b/lib/as3/ok/compareseq.as
new file mode 100644 (file)
index 0000000..ea61782
--- /dev/null
@@ -0,0 +1,42 @@
+package {
+    import flash.display.MovieClip
+
+    public class Main extends flash.display.MovieClip {
+
+        var count:int = 1;
+        var num:int = 16;
+
+        function istrue(b:Boolean) {
+            if(b) {
+                trace("ok "+count+"/"+num);
+            } else {
+                trace("error "+count+"/"+num);
+            }
+            count = count + 1
+        }
+        function isfalse(b:Boolean) {
+            istrue(!b);
+        }
+
+        function Main() {
+            trace("ok");
+            
+             istrue(1 < 2 < 3);
+            isfalse(2 < 1 < 3);
+            isfalse(3 < 2 < 1);
+            isfalse(1 < 3 < 2);
+            isfalse(2 < 3 < 1);
+            isfalse(3 < 1 < 2);
+             
+            isfalse(1 > 2 > 3);
+            isfalse(2 > 1 > 3);
+             istrue(3 > 2 > 1);
+            isfalse(1 > 3 > 2);
+            isfalse(2 > 3 > 1);
+            isfalse(3 > 1 > 2);
+
+            trace("[exit]");
+        }
+    }
+}
+
diff --git a/lib/as3/ok/extendclass.as b/lib/as3/ok/extendclass.as
new file mode 100644 (file)
index 0000000..a6e5288
--- /dev/null
@@ -0,0 +1,20 @@
+
+/* I can't make this work with Flash 10, with any compiler.
+
+   Error: Error #2136: The SWF file extendclass.swf
+   contains invalid data.
+*/
+
+package {
+
+    import flash.display.MovieClip
+    
+    public class Main extends flash.display.MovieClip {
+        function Main() {
+            var p = new ExtendMain();
+        }
+    }
+    
+    public class ExtendMain extends Main {
+    }
+}
diff --git a/lib/as3/ok/innerfunctionslots.as b/lib/as3/ok/innerfunctionslots.as
new file mode 100644 (file)
index 0000000..5326e2a
--- /dev/null
@@ -0,0 +1,20 @@
+package {
+    import flash.display.MovieClip
+    import flash.events.Event
+
+    public class Main extends flash.display.MovieClip {
+        public function test(e:Event) {
+            if(e.type instanceof String) {
+                trace("ok");
+            }
+
+            function inner(x:String) {
+                trace(e.type);
+            }
+        }
+        public function Main() {
+            var e = new Event("");
+            test(e);
+        }
+    }
+}