CVSROOT: /sources/gnash Module name: gnash Changes by: Sandro Santilli <strk> 07/12/11 19:23:50
Modified files: . : ChangeLog server : as_function.cpp server/asobj : ClassHierarchy.cpp Global.cpp testsuite/actionscript.all: Function.as String.as Log message: Don't set function prototypes to Function.prototype in SWF < 6, initialize String class manually (not sure why, but fixes more cases) CVSWeb URLs: http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.5134&r2=1.5135 http://cvs.savannah.gnu.org/viewcvs/gnash/server/as_function.cpp?cvsroot=gnash&r1=1.45&r2=1.46 http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/ClassHierarchy.cpp?cvsroot=gnash&r1=1.6&r2=1.7 http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/Global.cpp?cvsroot=gnash&r1=1.80&r2=1.81 http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/actionscript.all/Function.as?cvsroot=gnash&r1=1.59&r2=1.60 http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/actionscript.all/String.as?cvsroot=gnash&r1=1.29&r2=1.30 Patches: Index: ChangeLog =================================================================== RCS file: /sources/gnash/gnash/ChangeLog,v retrieving revision 1.5134 retrieving revision 1.5135 diff -u -b -r1.5134 -r1.5135 --- ChangeLog 11 Dec 2007 15:52:22 -0000 1.5134 +++ ChangeLog 11 Dec 2007 19:23:49 -0000 1.5135 @@ -1,5 +1,14 @@ 2007-12-11 Sandro Santilli <[EMAIL PROTECTED]> + * server/as_function.cpp: don't set function prototypes + to Function.prototype in SWF < 6. + * server/asobj/: ClassHierarchy.cpp, Global.cpp: initialize + string class manually, seems to be some special thing. + * testsuite/actionscript.all/: Function.as, String.as: successes + in prototype checking for swf5. + +2007-12-11 Sandro Santilli <[EMAIL PROTECTED]> + * testsuite/swfdec/PASSING: sync with master git. * server/swf_event.h: leave ownership of action_buffer to the caller as a single action buffer can be triggered by multiple Index: server/as_function.cpp =================================================================== RCS file: /sources/gnash/gnash/server/as_function.cpp,v retrieving revision 1.45 retrieving revision 1.46 diff -u -b -r1.45 -r1.46 --- server/as_function.cpp 18 Oct 2007 11:47:54 -0000 1.45 +++ server/as_function.cpp 11 Dec 2007 19:23:50 -0000 1.46 @@ -99,8 +99,14 @@ as_function::as_function() : // all functions inherit from global Function class - as_object(getFunctionPrototype()) + //as_object(getFunctionPrototype()) + as_object() { + if ( VM::get().getSWFVersion() > 5 ) + { + init_member(NSV::PROP_uuPROTOuu, as_value(getFunctionPrototype())); + } + as_object* iface = new as_object(getObjectInterface()); iface->init_member("constructor", this); init_member("prototype", as_value(iface)); @@ -111,8 +117,14 @@ as_function::as_function(as_object* iface) : // all functions inherit from global Function class - as_object(getFunctionPrototype()) + //as_object(getFunctionPrototype()) + as_object() { + if ( VM::get().getSWFVersion() > 5 ) + { + init_member(NSV::PROP_uuPROTOuu, as_value(getFunctionPrototype())); + } + if ( iface ) { iface->init_member("constructor", this); Index: server/asobj/ClassHierarchy.cpp =================================================================== RCS file: /sources/gnash/gnash/server/asobj/ClassHierarchy.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -u -b -r1.6 -r1.7 --- server/asobj/ClassHierarchy.cpp 23 Nov 2007 14:20:28 -0000 1.6 +++ server/asobj/ClassHierarchy.cpp 11 Dec 2007 19:23:50 -0000 1.7 @@ -250,7 +250,7 @@ { xmlnode_class_init, NSV::CLASS_X_M_L_NODE, NSV::CLASS_OBJECT, NSV::NS_FLASH_XML, 5 }, { mouse_class_init, NSV::CLASS_MOUSE, NSV::CLASS_OBJECT, NSV::NS_FLASH_UI, 5 }, { number_class_init, NSV::CLASS_NUMBER, NSV::CLASS_OBJECT, NS_GLOBAL, 5 }, - { string_class_init, NSV::CLASS_STRING, NSV::CLASS_OBJECT, NS_GLOBAL, 5 }, +// { string_class_init, NSV::CLASS_STRING, NSV::CLASS_OBJECT, NS_GLOBAL, 5 }, // string is special { key_class_init, NSV::CLASS_KEY, NSV::CLASS_OBJECT, NS_GLOBAL, 5 }, { AsBroadcaster_init, NSV::CLASS_AS_BROADCASTER, NSV::CLASS_OBJECT, NS_GLOBAL, 5 }, { textsnapshot_class_init, NSV::CLASS_TEXT_SNAPSHOT, NSV::CLASS_OBJECT, NSV::NS_FLASH_TEXT, 6 }, Index: server/asobj/Global.cpp =================================================================== RCS file: /sources/gnash/gnash/server/asobj/Global.cpp,v retrieving revision 1.80 retrieving revision 1.81 diff -u -b -r1.80 -r1.81 --- server/asobj/Global.cpp 11 Dec 2007 00:14:23 -0000 1.80 +++ server/asobj/Global.cpp 11 Dec 2007 19:23:50 -0000 1.81 @@ -17,7 +17,7 @@ // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA // -/* $Id: Global.cpp,v 1.80 2007/12/11 00:14:23 strk Exp $ */ +/* $Id: Global.cpp,v 1.81 2007/12/11 19:23:50 strk Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -451,6 +451,9 @@ array_class_init(*this); ch->getGlobalNs()->stubPrototype(NSV::CLASS_ARRAY); ch->getGlobalNs()->getClass(NSV::CLASS_ARRAY)->setDeclared(); + string_class_init(*this); + ch->getGlobalNs()->stubPrototype(NSV::CLASS_STRING); + ch->getGlobalNs()->getClass(NSV::CLASS_STRING)->setDeclared(); } if (vm.getSWFVersion() >= 6) { Index: testsuite/actionscript.all/Function.as =================================================================== RCS file: /sources/gnash/gnash/testsuite/actionscript.all/Function.as,v retrieving revision 1.59 retrieving revision 1.60 diff -u -b -r1.59 -r1.60 --- testsuite/actionscript.all/Function.as 28 Nov 2007 12:23:47 -0000 1.59 +++ testsuite/actionscript.all/Function.as 11 Dec 2007 19:23:50 -0000 1.60 @@ -21,7 +21,7 @@ // compile this test case with Ming makeswf, and then // execute it like this gnash -1 -r 0 -v out.swf -rcsid="$Id: Function.as,v 1.59 2007/11/28 12:23:47 strk Exp $"; +rcsid="$Id: Function.as,v 1.60 2007/12/11 19:23:50 strk Exp $"; #include "check.as" @@ -475,7 +475,7 @@ check(Object.prototype.hasOwnProperty('toString')); check_equals(textOutFunc.toString, Object.prototype.toString); #else -xcheck_equals(typeof(textOutFunc.toString), 'undefined'); +check_equals(typeof(textOutFunc.toString), 'undefined'); #endif textOutFunc.toString = function() { return "custom text rep"; }; #if OUTPUT_VERSION >= 6 @@ -575,7 +575,7 @@ // tells us so #if OUTPUT_VERSION == 5 // Function is supported in SWF6 and above -xcheck_equals(Email.constructor.toString(), undefined); +check_equals(Email.constructor.toString(), undefined); check_equals(Function, undefined); #endif check_equals(typeof(Email.constructor), 'function'); Index: testsuite/actionscript.all/String.as =================================================================== RCS file: /sources/gnash/gnash/testsuite/actionscript.all/String.as,v retrieving revision 1.29 retrieving revision 1.30 diff -u -b -r1.29 -r1.30 --- testsuite/actionscript.all/String.as 11 Dec 2007 11:34:58 -0000 1.29 +++ testsuite/actionscript.all/String.as 11 Dec 2007 19:23:50 -0000 1.30 @@ -16,17 +16,13 @@ // Original author: Mike Carlson - June 19th, 2006 -rcsid="$Id: String.as,v 1.29 2007/12/11 11:34:58 strk Exp $"; +rcsid="$Id: String.as,v 1.30 2007/12/11 19:23:50 strk Exp $"; #include "check.as" check_equals(typeof(String), 'function'); check_equals(typeof(String.prototype), 'object'); -#if OUTPUT_VERSION > 5 - check_equals(String.__proto__, Function.prototype); // both undefined in swf5 -#else - xcheck_equals(String.__proto__, Function.prototype); // gnash fails -#endif +check_equals(String.__proto__, Function.prototype); // both undefined in swf5 check_equals(typeof(String.prototype.valueOf), 'function'); check_equals(typeof(String.prototype.toString), 'function'); check_equals(typeof(String.prototype.toUpperCase), 'function'); @@ -45,8 +41,8 @@ check_equals(typeof(String.valueOf), 'function'); check_equals(typeof(String.toString), 'function'); #else - xcheck_equals(typeof(String.valueOf), 'undefined'); - xcheck_equals(typeof(String.toString), 'undefined'); + check_equals(typeof(String.valueOf), 'undefined'); + check_equals(typeof(String.toString), 'undefined'); #endif check_equals(typeof(String.toUpperCase), 'undefined'); check_equals(typeof(String.toLowerCase), 'undefined'); _______________________________________________ Gnash-commit mailing list Gnash-commit@gnu.org http://lists.gnu.org/mailman/listinfo/gnash-commit