CVSROOT: /sources/gnash Module name: gnash Changes by: Sandro Santilli <strk> 07/08/02 18:28:43
Modified files: . : ChangeLog server : as_value.cpp as_value.h server/vm : ASHandlers.cpp Log message: * server/as_value.{cpp,h}: as_environment parameter made mandatory for the equals() method. * server/vm/ASHandlers.cpp (ActionEquals): update calls to as_value::equals(). CVSWeb URLs: http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.3917&r2=1.3918 http://cvs.savannah.gnu.org/viewcvs/gnash/server/as_value.cpp?cvsroot=gnash&r1=1.61&r2=1.62 http://cvs.savannah.gnu.org/viewcvs/gnash/server/as_value.h?cvsroot=gnash&r1=1.60&r2=1.61 http://cvs.savannah.gnu.org/viewcvs/gnash/server/vm/ASHandlers.cpp?cvsroot=gnash&r1=1.115&r2=1.116 Patches: Index: ChangeLog =================================================================== RCS file: /sources/gnash/gnash/ChangeLog,v retrieving revision 1.3917 retrieving revision 1.3918 diff -u -b -r1.3917 -r1.3918 --- ChangeLog 2 Aug 2007 18:16:17 -0000 1.3917 +++ ChangeLog 2 Aug 2007 18:28:42 -0000 1.3918 @@ -1,5 +1,12 @@ 2007-08-02 Sandro Santilli <[EMAIL PROTECTED]> + * server/as_value.{cpp,h}: as_environment parameter made mandatory + for the equals() method. + * server/vm/ASHandlers.cpp (ActionEquals): update calls to + as_value::equals(). + +2007-08-02 Sandro Santilli <[EMAIL PROTECTED]> + * testsuite/actionscript.all/array.as: add test for Array.valueOf(). * server/as_value.cpp (equals) : fix true==1 and true!=2 (was failing). Index: server/as_value.cpp =================================================================== RCS file: /sources/gnash/gnash/server/as_value.cpp,v retrieving revision 1.61 retrieving revision 1.62 diff -u -b -r1.61 -r1.62 --- server/as_value.cpp 2 Aug 2007 17:35:57 -0000 1.61 +++ server/as_value.cpp 2 Aug 2007 18:28:42 -0000 1.62 @@ -630,7 +630,7 @@ } bool -as_value::equals(const as_value& v, as_environment* env) const +as_value::equals(const as_value& v, as_environment& env) const { //log_msg("equals(%s, %s) called", to_debug_string().c_str(), v.to_debug_string().c_str()); @@ -650,31 +650,30 @@ else if (m_type == NUMBER && v.m_type == STRING) { - return equalsSameType(v.to_number(env)); // m_number_value == v.to_number(env); + return equalsSameType(v.to_number(&env)); } else if (v.m_type == NUMBER && m_type == STRING) { - return v.equalsSameType(to_number(env)); // v.m_number_value == to_number(env); + return v.equalsSameType(to_number(&env)); } else if (m_type == STRING) { - return m_string_value == v.to_string(env); + return m_string_value == v.to_string(&env); } else if (m_type == BOOLEAN) { - return as_value(to_number(env)).equals(v); // m_boolean_value == v.to_bool(); + return as_value(to_number(&env)).equals(v, env); // m_boolean_value == v.to_bool(); } else if (v.m_type == BOOLEAN) { - return as_value(v.to_number()).equals(*this); + return as_value(v.to_number(&env)).equals(*this, env); } else if (m_type == OBJECT || m_type == AS_FUNCTION) { assert ( ! (v.m_type == OBJECT || v.m_type == AS_FUNCTION) ); // convert this value to a primitive and recurse - if ( ! env ) return false; - as_value v2 = to_primitive(*env); + as_value v2 = to_primitive(env); if ( v2.m_type == OBJECT || v2.m_type == AS_FUNCTION ) return false; // no valid conversion else return v2.equals(v, env); } @@ -683,8 +682,7 @@ { assert ( ! (m_type == OBJECT || m_type == AS_FUNCTION) ); // convert this value to a primitive and recurse - if ( ! env ) return false; - as_value v2 = v.to_primitive(*env); + as_value v2 = v.to_primitive(env); if ( v2.m_type == OBJECT || v2.m_type == AS_FUNCTION ) return false; // no valid conversion else return equals(v2, env); } Index: server/as_value.h =================================================================== RCS file: /sources/gnash/gnash/server/as_value.h,v retrieving revision 1.60 retrieving revision 1.61 diff -u -b -r1.60 -r1.61 --- server/as_value.h 25 Jul 2007 16:27:55 -0000 1.60 +++ server/as_value.h 2 Aug 2007 18:28:42 -0000 1.61 @@ -15,7 +15,7 @@ // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -/* $Id: as_value.h,v 1.60 2007/07/25 16:27:55 strk Exp $ */ +/* $Id: as_value.h,v 1.61 2007/08/02 18:28:42 strk Exp $ */ #ifndef GNASH_AS_VALUE_H #define GNASH_AS_VALUE_H @@ -533,12 +533,11 @@ /// - A == B is equivalent to B == A, except for order of /// evaluation of A and B. /// - /// /// @param env - /// The environment to use for running the toString() method - /// for object values. If NULL, toString() won't be run. + /// The environment to use for running the toString() and valueOf() + /// methods for object values. /// - bool equals(const as_value& v, as_environment* env=NULL) const; + bool equals(const as_value& v, as_environment& env) const; /// Sets this value to this string plus the given string. void string_concat(const std::string& str); Index: server/vm/ASHandlers.cpp =================================================================== RCS file: /sources/gnash/gnash/server/vm/ASHandlers.cpp,v retrieving revision 1.115 retrieving revision 1.116 diff -u -b -r1.115 -r1.116 --- server/vm/ASHandlers.cpp 2 Aug 2007 17:21:37 -0000 1.115 +++ server/vm/ASHandlers.cpp 2 Aug 2007 18:28:42 -0000 1.116 @@ -17,7 +17,7 @@ // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA // -/* $Id: ASHandlers.cpp,v 1.115 2007/08/02 17:21:37 strk Exp $ */ +/* $Id: ASHandlers.cpp,v 1.116 2007/08/02 18:28:42 strk Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -2614,7 +2614,7 @@ thread.ensureStack(2); /// ECMA-262 abstract equality comparison (sect 11.9.3) - env.top(1).set_bool(env.top(1).equals(env.top(0), &env)); + env.top(1).set_bool(env.top(1).equals(env.top(0), env)); env.drop(1); } _______________________________________________ Gnash-commit mailing list Gnash-commit@gnu.org http://lists.gnu.org/mailman/listinfo/gnash-commit