add test for frames and bytes properties of empty movies
[swfdec.git] / test / trace / implements.as
blob90e95c578b5aaebfb647005b936123da8a56b786
1 // makeswf -v 7 -r 1 -o implements-7.swf implements.as
3 trace ("Test Implements ActionScript action");
6 trace ("A implements Array, XML");
8 var A = function () {
9 return {
10 constructor: A,
11 __proto__: A.prototype
15 trace ("Before");
16 var o = new A ();
17 trace (o instanceOf A);
18 trace (o instanceOf Array);
19 trace (o instanceOf XML);
20 trace (o instanceOf String);
22 asm {
23 push "test"
24 push "Array"
25 getvariable
26 push "XML"
27 getvariable
28 push 2
29 push "A"
30 getvariable
31 implements
32 trace
35 trace ("After");
36 var o = new A ();
37 trace (o instanceOf A);
38 trace (o instanceOf Array);
39 trace (o instanceOf XML);
40 trace (o instanceOf String);
43 trace ("B changes prototype to A.prototype");
44 var B = function () {
45 return {
46 constructor: B,
47 __proto__: B.prototype
51 trace ("Before");
52 o = new B ();
53 trace (o instanceOf A);
54 trace (o instanceOf Array);
55 trace (o instanceOf XML);
56 trace (o instanceOf String);
58 B.prototype = A.prototype;
60 trace ("After");
61 o = new B ();
62 trace (o instanceOf A);
63 trace (o instanceOf Array);
64 trace (o instanceOf XML);
65 trace (o instanceOf String);
68 trace ("C has A as parent");
69 var C = function () {
70 return {
71 constructor: C,
72 __proto__: C.prototype
75 C.prototype.__proto__ = A.prototype;
77 o = new C ();
78 trace (o instanceOf A);
79 trace (o instanceOf Array);
80 trace (o instanceOf XML);
81 trace (o instanceOf String);
84 trace ("A.prototype is reset");
86 A.prototype = new Object ();
88 var o = new A ();
89 trace (o instanceOf A);
90 trace (o instanceOf Array);
91 trace (o instanceOf XML);
92 trace (o instanceOf String);
95 loadMovie ("FSCommand:quit", "");