CVSROOT: /sources/gnash Module name: gnash Changes by: Sandro Santilli <strk> 07/09/12 06:44:52
Modified files: . : ChangeLog server : sprite_instance.cpp testsuite/misc-ming.all: registerClassTest2.c Log message: * server/sprite_instance.cpp (construct): properly initialize the '__constructor__' and 'constructor' members when a class was registered with our definition. * testsuite/misc-ming.all/registerClassTest2.c: no more failures here. CVSWeb URLs: http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.4280&r2=1.4281 http://cvs.savannah.gnu.org/viewcvs/gnash/server/sprite_instance.cpp?cvsroot=gnash&r1=1.334&r2=1.335 http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/misc-ming.all/registerClassTest2.c?cvsroot=gnash&r1=1.2&r2=1.3 Patches: Index: ChangeLog =================================================================== RCS file: /sources/gnash/gnash/ChangeLog,v retrieving revision 1.4280 retrieving revision 1.4281 diff -u -b -r1.4280 -r1.4281 --- ChangeLog 12 Sep 2007 06:44:22 -0000 1.4280 +++ ChangeLog 12 Sep 2007 06:44:51 -0000 1.4281 @@ -1,3 +1,10 @@ +2007-09-12 Sandro Santilli <[EMAIL PROTECTED]> + + * server/sprite_instance.cpp (construct): properly initialize + the '__constructor__' and 'constructor' members when a class + was registered with our definition. + * testsuite/misc-ming.all/registerClassTest2.c: no more failures here. + 2007-09-12 Chad Musick <[EMAIL PROTECTED]> * server/as_value.cpp: Make sure that exceptions don't Index: server/sprite_instance.cpp =================================================================== RCS file: /sources/gnash/gnash/server/sprite_instance.cpp,v retrieving revision 1.334 retrieving revision 1.335 diff -u -b -r1.334 -r1.335 --- server/sprite_instance.cpp 7 Sep 2007 14:49:11 -0000 1.334 +++ server/sprite_instance.cpp 12 Sep 2007 06:44:51 -0000 1.335 @@ -3364,6 +3364,22 @@ // we don't use the constructor return (should we?) (*ctor)(call); + + int swfversion = _vm.getSWFVersion(); + + // Set the '__constructor__' and 'constructor' members + // TODO: this would be best done by an as_function::constructInstance() + // method. We have one but it returns a new object rather then + // initializing a given object, we just need to add another one... + // + if ( swfversion > 5 ) + { + set_member("__constructor__", ctor); + if ( swfversion == 6 ) + { + set_member("constructor", ctor); + } + } } } Index: testsuite/misc-ming.all/registerClassTest2.c =================================================================== RCS file: /sources/gnash/gnash/testsuite/misc-ming.all/registerClassTest2.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -b -r1.2 -r1.3 --- testsuite/misc-ming.all/registerClassTest2.c 16 Aug 2007 06:16:03 -0000 1.2 +++ testsuite/misc-ming.all/registerClassTest2.c 12 Sep 2007 06:44:52 -0000 1.3 @@ -106,11 +106,11 @@ // succeed in swf7 and swf8 check_equals(mo, "clip1.constructor", "MovieClip"); #else if OUTPUT_VERSION == 6 - xcheck_equals(mo, "clip1.constructor", "theClass1"); + check_equals(mo, "clip1.constructor", "theClass1"); #endif - xcheck_equals(mo, "clip1.__constructor__", "theClass1"); + check_equals(mo, "clip1.__constructor__", "theClass1"); check_equals(mo, "clip2.constructor", "theClass2"); - xcheck_equals(mo, "clip2.__constructor__", "theClass2"); + check_equals(mo, "clip2.__constructor__", "theClass2"); check_equals(mo, "clip1.x", "60"); check_equals(mo, "clip2.x", "600"); check_equals(mo, "clip1._x", "0"); _______________________________________________ Gnash-commit mailing list Gnash-commit@gnu.org http://lists.gnu.org/mailman/listinfo/gnash-commit