new test case for reconcile problems
authorkramm <kramm>
Tue, 6 Jan 2009 21:28:22 +0000 (21:28 +0000)
committerkramm <kramm>
Tue, 6 Jan 2009 21:28:22 +0000 (21:28 +0000)
lib/as3/ok/reconcile.as [new file with mode: 0644]

diff --git a/lib/as3/ok/reconcile.as b/lib/as3/ok/reconcile.as
new file mode 100644 (file)
index 0000000..fd06ffc
--- /dev/null
@@ -0,0 +1,66 @@
+package {
+        import flash.display.MovieClip;
+       import flash.utils.ByteArray;
+
+       public class Main extends flash.display.MovieClip {
+
+            // test whether local variables with default value "null"
+            // will be coerced to their object
+            public function test1() {
+                var dataBuffer:Array;
+                while(true) {
+                    dataBuffer = new Array();
+                    if(dataBuffer)
+                        break;
+                }
+                trace("ok 1/5");
+            }
+
+            public function test2() {
+                var output:String = "";
+                while(output.length<1) {
+                    output += "abc".charAt(0);
+                }
+                trace("ok 2/5");
+            }
+
+            public function test3() {
+                var k:uint;
+
+                while(true) {
+                    for (var k:uint = 0; k < 4; k++) {
+                    }
+                    break;
+                }
+                trace("ok 3/5");
+            }
+
+            public function test4() {
+                var x:int;
+                var y:uint;
+                if(escape("")) {
+                    x = x+y;
+                    y = y+x;
+                }
+                trace("ok 4/5");
+            }
+            public function test5() {
+                var x:int;
+                var y:uint;
+                var z:int;
+                if(escape("")) {
+                    x = x*y;
+                    z = x*z;
+                }
+                trace("ok 5/5");
+            }
+
+            public function Main() {
+                test1();
+                test2();
+                test3();
+                test4();
+                test5();
+            }
+        }
+}