update copyright date
[gnash.git] / testsuite / misc-mtasc.all / inheritance.as
blob3b8ae2dcae1287b145446fedfa7be93a31e60220
1 #include "check.as"
3 class Test extends MovieClip
6 // constructor
7 function Test()
9 note("Test constructor called");
12 // Override MovieClip.lineTo
13 function lineTo()
17 function test_proto_ext()
19 note("This is "+this);
20 Function.prototype.make = function() { return true; };
21 check(arguments.callee.make());
24 function test_laszlo_core()
26 var A = function() { this.constructor = arguments.callee; };
27 A.prototype.test = function () { return true; }
29 var B = function () { this.constructor = arguments.callee; }
31 B.prototype = new A();
33 B.prototype.test = function () {
34 check( this.constructor.prototype.constructor.prototype.test() );
37 var binst = new B();
38 check_equals(typeof(binst), 'object');
39 check_equals(typeof(binst.test), 'function');
40 note("test_laszlo_core called");
41 binst.test();
44 function test_all()
46 check_equals(typeof(this.loadMovie), 'function');
47 check_equals(this.loadMovie, super.loadMovie);
48 check(this.lineTo != super.lineTo); // overridden
49 check_equals(typeof(this.test_laszlo_core), 'function');
50 check_equals(typeof(this.test_proto_ext), 'function');
51 this.test_laszlo_core();
52 check_equals(typeof(this.test_laszlo_core), 'function');
53 check_equals(typeof(this.test_proto_ext), 'function');
54 this.test_proto_ext();
55 check_equals(typeof(this.test_laszlo_core), 'function');
56 check_equals(typeof(this.test_proto_ext), 'function');
57 note("This is "+this);
61 static function main(mc)
63 var myTest = new Test;
64 myTest.test_all();
66 check_totals(13);
67 Dejagnu.done();