[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] gnash ChangeLog server/vm/ASHandlers.cpp testsu...
From: |
Sandro Santilli |
Subject: |
[Gnash-commit] gnash ChangeLog server/vm/ASHandlers.cpp testsu... |
Date: |
Wed, 21 Mar 2007 09:51:20 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Changes by: Sandro Santilli <strk> 07/03/21 09:51:20
Modified files:
. : ChangeLog
server/vm : ASHandlers.cpp
testsuite/actionscript.all: Function.as
Log message:
* server/vm/ASHandlers.cpp (ActionCallFunction):
When function is an object, invoke it's 'constructor';
Properly set the 'this' pointer.
* testsuite/actionscript.all/Function.as: more successes.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.2658&r2=1.2659
http://cvs.savannah.gnu.org/viewcvs/gnash/server/vm/ASHandlers.cpp?cvsroot=gnash&r1=1.69&r2=1.70
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/actionscript.all/Function.as?cvsroot=gnash&r1=1.37&r2=1.38
Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.2658
retrieving revision 1.2659
diff -u -b -r1.2658 -r1.2659
--- ChangeLog 21 Mar 2007 09:33:19 -0000 1.2658
+++ ChangeLog 21 Mar 2007 09:51:20 -0000 1.2659
@@ -1,3 +1,11 @@
+2007-03-21 Sandro Santilli <address@hidden>
+
+ * server/vm/ASHandlers.cpp (ActionCallFunction):
+ When function is an object, invoke it's 'constructor';
+ Properly set the 'this' pointer.
+ * testsuite/actionscript.all/Function.as: more successes.
+
+
2007-03-21 Zou Lunkai <address@hidden>
* testsuite/misc-ming.all/action_execution_order_extend_test.c:
Index: server/vm/ASHandlers.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/vm/ASHandlers.cpp,v
retrieving revision 1.69
retrieving revision 1.70
diff -u -b -r1.69 -r1.70
--- server/vm/ASHandlers.cpp 20 Mar 2007 16:41:00 -0000 1.69
+++ server/vm/ASHandlers.cpp 21 Mar 2007 09:51:20 -0000 1.70
@@ -14,7 +14,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: ASHandlers.cpp,v 1.69 2007/03/20 16:41:00 strk Exp $ */
+/* $Id: ASHandlers.cpp,v 1.70 2007/03/21 09:51:20 strk Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -2041,20 +2041,19 @@
//cerr << "At ActionCallFunction enter:"<<endl;
//env.dump_stack();
- as_value function = env.top(0);
- if ( ! function.is_function() )
- {
- // Let's consider it a as a string and lookup the function.
- function_name = function.to_string();
- function = thread.getVariable(function_name);
- if ( ! function.is_function() )
+ // Let's consider it a as a string and lookup the function.
+ as_value function = thread.getVariable(env.top(0).to_std_string());
+ if ( ! function.is_object() )
{
- IF_VERBOSE_ASCODING_ERRORS(
- log_aserror("error in call_function: "
- "'%s' is not a function",
- function_name.c_str());
- );
+ log_aserror("ActionCallFunction: %s is not an object",
env.top(0).to_string());
+ }
+ else if ( ! function.is_function() )
+ {
+ boost::intrusive_ptr<as_object> obj = function.to_object();
+ if ( ! obj->get_member("constructor", &function) )
+ {
+ log_aserror("Object doensn't have a construcor");
}
}
@@ -2078,7 +2077,7 @@
debugger.callStackPush(function_name);
debugger.matchBreakPoint(function_name, true);
#endif
- as_value result = call_method(function, &env, thread.getTarget(),
+ as_value result = call_method(function, &env, thread.getThisPointer(),
nargs, env.get_top_index() - 2);
//log_msg("Function's result: %s", result.to_string());
Index: testsuite/actionscript.all/Function.as
===================================================================
RCS file: /sources/gnash/gnash/testsuite/actionscript.all/Function.as,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -b -r1.37 -r1.38
--- testsuite/actionscript.all/Function.as 20 Mar 2007 21:48:49 -0000
1.37
+++ testsuite/actionscript.all/Function.as 21 Mar 2007 09:51:20 -0000
1.38
@@ -20,7 +20,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.37 2007/03/20 21:48:49 strk Exp $";
+rcsid="$Id: Function.as,v 1.38 2007/03/21 09:51:20 strk Exp $";
#include "check.as"
@@ -556,8 +556,8 @@
check_equals(myMail.subject, 'greetings');
#if OUTPUT_VERSION > 5
-xcheck_equals(myMail.to, 'you');
-xcheck_equals(myMail.message, 'hello');
+check_equals(myMail.to, 'you');
+check_equals(myMail.message, 'hello');
#else // OUTPUT_VERSION <= 5
// no 'super' defined for SWF5 and below, so don't expect it to be called
check_equals(typeof(myMail.to), 'undefined');