fd06ffc75f2dac638fb78a7e29577616902af638
[swftools.git] / lib / as3 / ok / reconcile.as
1 package {
2         import flash.display.MovieClip;
3         import flash.utils.ByteArray;
4
5         public class Main extends flash.display.MovieClip {
6
7             // test whether local variables with default value "null"
8             // will be coerced to their object
9             public function test1() {
10                 var dataBuffer:Array;
11                 while(true) {
12                     dataBuffer = new Array();
13                     if(dataBuffer)
14                         break;
15                 }
16                 trace("ok 1/5");
17             }
18
19             public function test2() {
20                 var output:String = "";
21                 while(output.length<1) {
22                     output += "abc".charAt(0);
23                 }
24                 trace("ok 2/5");
25             }
26
27             public function test3() {
28                 var k:uint;
29
30                 while(true) {
31                     for (var k:uint = 0; k < 4; k++) {
32                     }
33                     break;
34                 }
35                 trace("ok 3/5");
36             }
37
38             public function test4() {
39                 var x:int;
40                 var y:uint;
41                 if(escape("")) {
42                     x = x+y;
43                     y = y+x;
44                 }
45                 trace("ok 4/5");
46             }
47             public function test5() {
48                 var x:int;
49                 var y:uint;
50                 var z:int;
51                 if(escape("")) {
52                     x = x*y;
53                     z = x*z;
54                 }
55                 trace("ok 5/5");
56             }
57
58             public function Main() {
59                 test1();
60                 test2();
61                 test3();
62                 test4();
63                 test5();
64             }
65         }
66 }