X-Git-Url: http://git.asbjorn.it/?a=blobdiff_plain;ds=inline;f=lib%2Fas3%2Fok%2Freconcile.as;h=52049620bbc92fdb22b592fb0b99e370c2edb2a5;hb=42bba07c1573e32b0cf504e76619fd1bd0eb3dcd;hp=8a28dd33ae7ac63a4598b9f50c30dd8668cc7e2d;hpb=800236a054e9bde8bd023fd5d6ab51f9307254fc;p=swftools.git
diff --git a/lib/as3/ok/reconcile.as b/lib/as3/ok/reconcile.as
index 8a28dd3..5204962 100644
--- a/lib/as3/ok/reconcile.as
+++ b/lib/as3/ok/reconcile.as
@@ -4,6 +4,14 @@
public class Main extends flash.display.MovieClip {
+ public function test0() {
+ // simple sanity test
+ while(false) {
+ var x1:String;
+ }
+ trace("ok 1/10");
+ }
+
// test whether local variables with default value "null"
// will be coerced to their object
public function test1() {
@@ -13,7 +21,7 @@
if(dataBuffer)
break;
}
- trace("ok 1/8");
+ trace("ok 2/10");
}
public function test2() {
@@ -21,7 +29,7 @@
while(output.length<1) {
output += "abc".charAt(0);
}
- trace("ok 2/8");
+ trace("ok 3/10");
}
public function test3() {
@@ -32,7 +40,7 @@
}
break;
}
- trace("ok 3/8");
+ trace("ok 4/10");
}
public var b:Boolean = false;
@@ -44,7 +52,7 @@
x = x+y;
y = y+x;
}
- trace("ok 4/8");
+ trace("ok 5/10");
}
public function test5() {
var x:int;
@@ -54,19 +62,19 @@
x = x*y;
z = x*z;
}
- trace("ok 5/8");
+ trace("ok 6/10");
}
public function test6() {
var i:int = b?3.0:3;
var j:uint = b?3:"abc";
- trace("ok 6/8");
+ trace("ok 7/10");
}
public function test7() {
var j:Number = 0;
if(b) {
j += 8;
}
- trace("ok 7/8");
+ trace("ok 8/10");
}
public function s():String {
return "x";
@@ -89,10 +97,111 @@
if(!b) {
i = s();
}
- trace("ok 8/8");
+ trace("ok 9/10");
+ }
+
+ public function test_add() {
+ var i:int = 3;
+ var s:String = "4";
+ var any1 = "any1";
+ var any2 = "any2";
+ var xml:XML =
+ var xmllist:XMLList = XMLList()
+ var d1:Date = new Date();
+ var d2:Date = new Date();
+ var array1:Array = [1];
+ var array2:Array = [1,2];
+
+ /* int+String */
+ var z1a:Object;
+ var z1b:String;
+ if(b) {
+ z1a = i+s;
+ z1b = i+s;
+ }
+
+ /* String+int */
+ var z2a:Object;
+ var z2b:String;
+ if(b) {
+ z2a = s+i;
+ z2b = s+i;
+ }
+
+ /* any+any */
+ var z3a:*;
+ var z3b:Object;
+ if(b) {
+ z3a = any1+any2;
+ z3b = any1+any2;
+ }
+
+ /* any+String */
+ var z4a:Object;
+ var z4b:*;
+ if(b) {
+ z4a = any1+s;
+ z4b = any1+s;
+ }
+
+ /* xml+xmllist */
+ var z5a:Object;
+ var z5b:XMLList;
+ if(b) {
+ z5a = xml+xmllist;
+ z5b = xml+xmllist;
+ }
+
+ /* xmllist+xml */
+ var z6:Object;
+ if(b) {
+ z6 = xmllist+xml;
+ }
+
+ /* xml+any */
+ var z7a:*;
+ var z7b:XMLList;
+ if(b) {
+ z7a = xml+any1;
+ z7b = xml+any1;
+ }
+
+ /* date+date */
+ var z8a:Object;
+ var z8b:String;
+ if(b) {
+ z8a = d1+d2;
+ z8b = d1+d2;
+ }
+
+ /* date+any */
+ var z9a:Object;
+ var z9b:String;
+ if(b) {
+ z9a = d1+any1;
+ z9b = d1+any1;
+ }
+
+ /* any+date */
+ var z10a:Object;
+ var z10b:*;
+ if(b) {
+ z10a = any1+d1;
+ z10b = any1+d1;
+ }
+
+ /* array+array */
+ var z11a:Object;
+ var z11b:Array;
+ if(b) {
+ z11a = array1+array2;
+ z11b = array1+array2;
+ }
+ trace("ok 10/10");
}
public function Main() {
+ test0();
test1();
test2();
test3();
@@ -101,6 +210,7 @@
test6();
test7();
test8();
+ test_add();
trace("[exit]");
}