test for typeof()
authorkramm <kramm>
Tue, 30 Dec 2008 22:51:23 +0000 (22:51 +0000)
committerkramm <kramm>
Tue, 30 Dec 2008 22:51:23 +0000 (22:51 +0000)
lib/as3/ok/typeof.as [new file with mode: 0644]

diff --git a/lib/as3/ok/typeof.as b/lib/as3/ok/typeof.as
new file mode 100644 (file)
index 0000000..029fde0
--- /dev/null
@@ -0,0 +1,16 @@
+package {
+    import flash.display.MovieClip;
+    public class Main extends flash.display.MovieClip {
+        function f() {}
+        function Main() {
+            if(typeof(3)=="number") trace("ok 1/7");
+            if(typeof("")=="string") trace("ok 2/7");
+            if(typeof(this)=="object") trace("ok 3/7");
+            if(typeof(undefined)=="undefined") trace("ok 4/7");
+            if(typeof(null)=="object") trace("ok 5/7");
+            if(typeof(f)=="function") trace("ok 6/7");
+            if(typeof(Main)=="object" ||
+               typeof(Main)=="movieclip") trace("ok 7/7");
+        }
+    }
+}