added test for class-level anonymous functions
authorMatthias Kramm <kramm@quiss.org>
Wed, 11 Feb 2009 15:04:11 +0000 (16:04 +0100)
committerMatthias Kramm <kramm@quiss.org>
Wed, 11 Feb 2009 15:04:11 +0000 (16:04 +0100)
lib/as3/ok/anonymous_functions.as

index 6b05500..3ae87c7 100644 (file)
@@ -2,6 +2,8 @@ package {
     import flash.display.MovieClip
     import flash.geom.Point
 
+    public var func:Function = function(nr:uint) {trace("ok "+nr+"/4");}
+
     public class Main extends flash.display.MovieClip {
         
         function run(f:Function, text:String) {
@@ -12,11 +14,13 @@ package {
             var log = function(text) {
                 trace(text);
             }
-            log("ok 1/3");
+            log("ok 1/4");
             var l = log;
-            l("ok 2/3");
+            l("ok 2/4");
+
+            run(function(text) {trace(text)}, "ok 3/4")
 
-            run(function(text) {trace(text)}, "ok 3/3")
+            func(4);
 
             trace("[exit]");
         }