> #if OUTPUT_VERSION > 5 > +check_equals(Email.constructor, Function); > +check_equals(Email.constructor.constructor, Function); > +check_equals(Email.constructor.constructor.constructor, Function); > ...
Background: Email is the name of a normal function. In SWF5, the above checks are also expected to be passed, but don't make much sense. Since in SWF5, Email.constructor.toString() == 'undefined' and Function == undefined. Gnash passed it by luck before with(1)Email.constructor.toString() == '[type Function]' and (2)initialized Function class for SWF5(Function.toString() == '[type Function]'). But both (1) and (2) were not the expected behaviour. --zou On 9/11/07, Zou Lunkai <[EMAIL PROTECTED]> wrote: > CVSROOT: /sources/gnash > Module name: gnash > Changes by: Zou Lunkai <zoulunkai> 07/09/11 05:46:32 > > Modified files: > . : ChangeLog > server/asobj : Global.cpp > testsuite/actionscript.all: Function.as Inheritance.as Number.as > toString_valueOf.as > > Log message: > * server/asobj/Global.cpp: don't initialize Function class for SWF < 6. > * testsuite/actionscript.all/Inheritance.as, > testsuite/actionscript.all/Function.as: disable a few confusing > and duplicated(but correct) tests for SWF5. more passes. > * testsuite/actionscript.all/Number.as, > testsuite/actionscript.all/toString_valueOf.as: more passes. > > CVSWeb URLs: > http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.4265&r2=1.4266 > http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/Global.cpp?cvsroot=gnash&r1=1.66&r2=1.67 > http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/actionscript.all/Function.as?cvsroot=gnash&r1=1.54&r2=1.55 > http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/actionscript.all/Inheritance.as?cvsroot=gnash&r1=1.36&r2=1.37 > http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/actionscript.all/Number.as?cvsroot=gnash&r1=1.28&r2=1.29 > http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/actionscript.all/toString_valueOf.as?cvsroot=gnash&r1=1.12&r2=1.13 > > Patches: > Index: ChangeLog > =================================================================== > RCS file: /sources/gnash/gnash/ChangeLog,v > retrieving revision 1.4265 > retrieving revision 1.4266 > diff -u -b -r1.4265 -r1.4266 > --- ChangeLog 11 Sep 2007 00:17:43 -0000 1.4265 > +++ ChangeLog 11 Sep 2007 05:46:31 -0000 1.4266 > @@ -1,3 +1,12 @@ > +2007-09-11 Zou Lunkai <[EMAIL PROTECTED]> > + > + * server/asobj/Global.cpp: don't initialize Function class for SWF < > 6. > + * testsuite/actionscript.all/Inheritance.as, > + testsuite/actionscript.all/Function.as: disable a few confusing > + and duplicated(but correct) tests for SWF5. more passes. > + * testsuite/actionscript.all/Number.as, > + testsuite/actionscript.all/toString_valueOf.as: more passes. > + > 2007-09-10 Rob Savoye <[EMAIL PROTECTED]> > > * macros/curl.m4: sed any "-L/usr/lib" off the output of > > Index: server/asobj/Global.cpp > =================================================================== > RCS file: /sources/gnash/gnash/server/asobj/Global.cpp,v > retrieving revision 1.66 > retrieving revision 1.67 > diff -u -b -r1.66 -r1.67 > --- server/asobj/Global.cpp 24 Jul 2007 14:19:31 -0000 1.66 > +++ server/asobj/Global.cpp 11 Sep 2007 05:46:31 -0000 1.67 > @@ -17,7 +17,7 @@ > // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA > // > > -/* $Id: Global.cpp,v 1.66 2007/07/24 14:19:31 strk Exp $ */ > +/* $Id: Global.cpp,v 1.67 2007/09/11 05:46:31 zoulunkai Exp $ */ > > #ifdef HAVE_CONFIG_H > #include "config.h" > @@ -377,11 +377,10 @@ > init_member("setInterval", new builtin_function(timer_setinterval)); > init_member("clearInterval", new > builtin_function(timer_clearinterval)); > > - // System and Function were added in Player Version 6, but > + // System was added in Player Version 6, but > // seem to be available even if SWF target version is > // inferior > system_class_init(*this); // System and System.capabilities > - function_class_init(*this); > > // I find Stage object used in SWF5 movies, don't > // see a good reason not to enable this always > @@ -442,7 +441,7 @@ > //----------------------- > // SWF6 > //----------------------- > - > + function_class_init(*this); > // See: http://sephiroth.it/reference.php?id=717&cat=1 > textsnapshot_class_init(*this); > init_member("LocalConnection", new > builtin_function(localconnection_new)); > > Index: testsuite/actionscript.all/Function.as > =================================================================== > RCS file: /sources/gnash/gnash/testsuite/actionscript.all/Function.as,v > retrieving revision 1.54 > retrieving revision 1.55 > diff -u -b -r1.54 -r1.55 > --- testsuite/actionscript.all/Function.as 31 Aug 2007 21:53:33 -0000 > 1.54 > +++ testsuite/actionscript.all/Function.as 11 Sep 2007 05:46:31 -0000 > 1.55 > @@ -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.54 2007/08/31 21:53:33 strk Exp $"; > +rcsid="$Id: Function.as,v 1.55 2007/09/11 05:46:31 zoulunkai Exp $"; > > #include "check.as" > > @@ -545,13 +545,19 @@ > > // Email is a Function instance, and it's "constructor" property > // tells us so > +#if OUTPUT_VERSION == 5 > +// Function is supported in SWF6 and above > +xcheck_equals(Email.constructor.toString(), undefined); > +check_equals(Function, undefined); > +#endif > check_equals(typeof(Email.constructor), 'function'); > -check_equals(Email.constructor, Function); > check_equals(typeof(Email.constructor.constructor), 'function'); > -check_equals(Email.constructor.constructor, Function); > check_equals(typeof(Email.constructor.constructor.constructor), 'function'); > -check_equals(Email.constructor.constructor.constructor, Function); > #if OUTPUT_VERSION > 5 > +check_equals(Email.constructor, Function); > +check_equals(Email.constructor.constructor, Function); > +check_equals(Email.constructor.constructor.constructor, Function); > + > check(Email.hasOwnProperty('constructor')); > check(Email.constructor.hasOwnProperty('constructor')); > check(Email.constructor.constructor.hasOwnProperty('constructor')); > > Index: testsuite/actionscript.all/Inheritance.as > =================================================================== > RCS file: /sources/gnash/gnash/testsuite/actionscript.all/Inheritance.as,v > retrieving revision 1.36 > retrieving revision 1.37 > diff -u -b -r1.36 -r1.37 > --- testsuite/actionscript.all/Inheritance.as 1 Sep 2007 09:40:06 -0000 > 1.36 > +++ testsuite/actionscript.all/Inheritance.as 11 Sep 2007 05:46:32 -0000 > 1.37 > @@ -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: Inheritance.as,v 1.36 2007/09/01 09:40:06 strk Exp $"; > +rcsid="$Id: Inheritance.as,v 1.37 2007/09/11 05:46:32 zoulunkai Exp $"; > > #include "check.as" > > @@ -52,7 +52,8 @@ > // rather then on *SWF* version, in which case > // we should completely avoid testing it. > // Can anyone confirm ? > -xcheck_equals(typeof(functionObject), 'undefined'); > +// This is because SWF5 does not support Function class. > +check_equals(typeof(functionObject), 'undefined'); > #endif > > // functionObject '__proto__' is a reference to > @@ -79,7 +80,9 @@ > > // Make 'userFunc' be a function (should inherit Function things) > var userFunc = function() {}; > +#if OUTPUT_VERSION > 5 > check_equals (userFunc.__proto__, Function.prototype); > +#endif > check_equals (userFunc.prototype.constructor, userFunc); > check_equals (userFunc.prototype.apply, undefined); > check_equals (userFunc.apply, Function.prototype.apply); > @@ -125,7 +128,9 @@ > { > if ( changeit ) this.__constructor__ = Object; > } > +#if OUTPUT_VERSION > 5 > check_equals(TypeChanger.__proto__, Function.prototype); > +#endif > > o1 = new TypeChanger(false); > check_equals(o1.__proto__, TypeChanger.prototype); > @@ -232,7 +237,9 @@ > check(SubObj1.prototype != undefined); > check_equals(SubObj1.prototype.constructor, SubObj1); > > +#if OUTPUT_VERSION > 5 > check_equals(SubObj1.prototype.constructor.__proto__.constructor, Function); > +#endif > > //------------------------------------------------ > // Test the 'extends' tag (require ming > 0.4.0.beta3) > @@ -277,8 +284,9 @@ > check(! DerivedClass1.prototype.hasOwnProperty('valueOf')); > check(! DerivedClass1.prototype.hasOwnProperty('constructor')); > check(DerivedClass1.hasOwnProperty('constructor')); > -#endif > check_equals(DerivedClass1.constructor, Function); > +#endif > + > check_equals(DerivedClass1.prototype.__proto__.constructor, BaseClass1); > check_equals(DerivedClass1.prototype.__proto__, BaseClass1.prototype); > > > Index: testsuite/actionscript.all/Number.as > =================================================================== > RCS file: /sources/gnash/gnash/testsuite/actionscript.all/Number.as,v > retrieving revision 1.28 > retrieving revision 1.29 > diff -u -b -r1.28 -r1.29 > --- testsuite/actionscript.all/Number.as 25 Aug 2007 14:15:51 -0000 > 1.28 > +++ testsuite/actionscript.all/Number.as 11 Sep 2007 05:46:32 -0000 > 1.29 > @@ -27,7 +27,7 @@ > // TODO: test with SWF target != 6 (the only one tested so far) > // > > -rcsid="$Id: Number.as,v 1.28 2007/08/25 14:15:51 strk Exp $"; > +rcsid="$Id: Number.as,v 1.29 2007/09/11 05:46:32 zoulunkai Exp $"; > > #include "check.as" > > @@ -288,7 +288,7 @@ > xcheck_equals(typeof(Number.valueOf), 'undefined'); > xcheck_equals(typeof(Number.__proto__), 'undefined'); > xcheck_equals(typeof(Number.toString), 'undefined'); > -xcheck_equals(typeof(Function), 'undefined'); > +check_equals(typeof(Function), 'undefined'); > #endif > > a = 1; > > Index: testsuite/actionscript.all/toString_valueOf.as > =================================================================== > RCS file: > /sources/gnash/gnash/testsuite/actionscript.all/toString_valueOf.as,v > retrieving revision 1.12 > retrieving revision 1.13 > diff -u -b -r1.12 -r1.13 > --- testsuite/actionscript.all/toString_valueOf.as 2 Sep 2007 00:12:48 > -0000 1.12 > +++ testsuite/actionscript.all/toString_valueOf.as 11 Sep 2007 05:46:32 > -0000 1.13 > @@ -46,11 +46,11 @@ > check_equals(typeof(Function.prototype['valueOf']), 'function'); > #else > // No Function Object in swf5??? > - xcheck_equals(typeof(Function), 'undefined'); > + check_equals(typeof(Function), 'undefined'); > > // Function Object in swf5 does not support toString and valueOf > - xcheck_equals(Function.prototype['toString'], undefined); > - xcheck_equals(Function.prototype['valueOf'], undefined); > + check_equals(Function.prototype['toString'], undefined); > + check_equals(Function.prototype['valueOf'], undefined); > > // test 'function' is supported in swf5:) > x = function () {}; > > > _______________________________________________ > Gnash-commit mailing list > Gnash-commit@gnu.org > http://lists.gnu.org/mailman/listinfo/gnash-commit > _______________________________________________ Gnash-commit mailing list Gnash-commit@gnu.org http://lists.gnu.org/mailman/listinfo/gnash-commit