[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] gnash ChangeLog server/as_environment.cpp serve...
From: |
Zou Lunkai |
Subject: |
[Gnash-commit] gnash ChangeLog server/as_environment.cpp serve... |
Date: |
Sun, 30 Sep 2007 05:24:37 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Changes by: Zou Lunkai <zoulunkai> 07/09/30 05:24:36
Modified files:
. : ChangeLog
server : as_environment.cpp as_environment.h
server/vm : ActionExec.cpp ActionExec.h
testsuite/actionscript.all: with.as
Log message:
* server/environment.{h, cpp}: get_variable_raw() set 'this' to the
orignial target
instead of the current one.
* server/vm/ActionExec.{h, cpp}: getThisPointer() returns the original
target for
golbal code.
* testsuite/actionsrcipt.all/with.as: xchecks to checks(fix 'this'
context)
(patch from strk, I just checked it)
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.4481&r2=1.4482
http://cvs.savannah.gnu.org/viewcvs/gnash/server/as_environment.cpp?cvsroot=gnash&r1=1.92&r2=1.93
http://cvs.savannah.gnu.org/viewcvs/gnash/server/as_environment.h?cvsroot=gnash&r1=1.56&r2=1.57
http://cvs.savannah.gnu.org/viewcvs/gnash/server/vm/ActionExec.cpp?cvsroot=gnash&r1=1.53&r2=1.54
http://cvs.savannah.gnu.org/viewcvs/gnash/server/vm/ActionExec.h?cvsroot=gnash&r1=1.23&r2=1.24
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/actionscript.all/with.as?cvsroot=gnash&r1=1.18&r2=1.19
Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.4481
retrieving revision 1.4482
diff -u -b -r1.4481 -r1.4482
--- ChangeLog 30 Sep 2007 01:50:48 -0000 1.4481
+++ ChangeLog 30 Sep 2007 05:24:35 -0000 1.4482
@@ -1,3 +1,11 @@
+2007-09-30 Sandro Santilli <address@hidden>
+
+ * server/environment.{h, cpp}: get_variable_raw() set 'this' to the
orignial target
+ instead of the current one.
+ * server/vm/ActionExec.{h, cpp}: getThisPointer() returns the original
target for
+ golbal code.
+ * testsuite/actionsrcipt.all/with.as: xchecks to checks(fix 'this'
context)
+
2007-09-30 Zou Lunkai <address@hidden>
* testsuite/misc-swfc.all/movieclip_destruction_test3.sc: '_root' is
always
Index: server/as_environment.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/as_environment.cpp,v
retrieving revision 1.92
retrieving revision 1.93
diff -u -b -r1.92 -r1.93
--- server/as_environment.cpp 26 Sep 2007 20:52:02 -0000 1.92
+++ server/as_environment.cpp 30 Sep 2007 05:24:36 -0000 1.93
@@ -17,7 +17,7 @@
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
//
-/* $Id: as_environment.cpp,v 1.92 2007/09/26 20:52:02 strk Exp $ */
+/* $Id: as_environment.cpp,v 1.93 2007/09/30 05:24:36 zoulunkai Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -112,7 +112,7 @@
// const_cast needed due to non-const as_object::get_member
as_object* obj = const_cast<as_object*>(scopeStack[i-1].get());
if (obj && obj->get_member(VM::get().getStringTable().find(varname),
&val)) {
- // Found the var in this context.
+ // Found the var in with context.
if ( retTarget ) *retTarget = obj;
return val;
}
@@ -126,15 +126,15 @@
}
- // Check target members.
+ // Check current target members.
if (m_target->get_member(VM::get().getStringTable().find(varname), &val)) {
if ( retTarget ) *retTarget = m_target;
return val;
}
- // Looking for "this"?
+ // Looking for "this"
if (varname == "this") {
- val.set_as_object(m_target);
+ val.set_as_object(_original_target);
if ( retTarget ) *retTarget = NULL; // correct ??
return val;
}
Index: server/as_environment.h
===================================================================
RCS file: /sources/gnash/gnash/server/as_environment.h,v
retrieving revision 1.56
retrieving revision 1.57
diff -u -b -r1.56 -r1.57
--- server/as_environment.h 24 Aug 2007 10:37:56 -0000 1.56
+++ server/as_environment.h 30 Sep 2007 05:24:36 -0000 1.57
@@ -58,6 +58,8 @@
character* get_target() { return m_target; }
void set_target(character* target);
+ character* get_original_target() { return _original_target; }
+
// Reset target to its original value
void reset_target() { m_target = _original_target; }
Index: server/vm/ActionExec.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/vm/ActionExec.cpp,v
retrieving revision 1.53
retrieving revision 1.54
diff -u -b -r1.53 -r1.54
--- server/vm/ActionExec.cpp 27 Sep 2007 08:10:17 -0000 1.53
+++ server/vm/ActionExec.cpp 30 Sep 2007 05:24:36 -0000 1.54
@@ -17,7 +17,7 @@
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
//
-/* $Id: ActionExec.cpp,v 1.53 2007/09/27 08:10:17 strk Exp $ */
+/* $Id: ActionExec.cpp,v 1.54 2007/09/30 05:24:36 zoulunkai Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -728,6 +728,12 @@
}
}
+as_object*
+ActionExec::getThisPointer()
+{
+ return _function_var ? _this_ptr.get() : env.get_original_target();
+}
+
} // end of namespace gnash
Index: server/vm/ActionExec.h
===================================================================
RCS file: /sources/gnash/gnash/server/vm/ActionExec.h,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -b -r1.23 -r1.24
--- server/vm/ActionExec.h 27 Sep 2007 06:25:08 -0000 1.23
+++ server/vm/ActionExec.h 30 Sep 2007 05:24:36 -0000 1.24
@@ -277,7 +277,7 @@
bool isFunction() { return _function_var!=0; }
/// Get the current 'this' pointer, for use in function calls
- as_object* getThisPointer() { return _function_var ? _this_ptr.get() :
getTarget(); }
+ as_object* getThisPointer();
/// Returns the scope stack associated with this execution thread
//
Index: testsuite/actionscript.all/with.as
===================================================================
RCS file: /sources/gnash/gnash/testsuite/actionscript.all/with.as,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -b -r1.18 -r1.19
--- testsuite/actionscript.all/with.as 29 Sep 2007 16:40:38 -0000 1.18
+++ testsuite/actionscript.all/with.as 30 Sep 2007 05:24:36 -0000 1.19
@@ -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: with.as,v 1.18 2007/09/29 16:40:38 strk Exp $";
+rcsid="$Id: with.as,v 1.19 2007/09/30 05:24:36 zoulunkai Exp $";
#include "check.as"
@@ -270,7 +270,7 @@
_global.xfail_check = xfail_check;
setTarget('/clip1'); //tag 0x8B
- xcheck_equals(this, _level0);
+ check_equals(this, _level0);
check_equals(testvar, 'clip1_var');
// won't search timeline properties, different with ActionWith
check_equals(testvar2, 'global_var');
@@ -278,7 +278,7 @@
setTarget("");
setTarget('/clip1/clip2'); //tag 0x8B
- xcheck_equals(this, _level0);
+ check_equals(this, _level0);
check_equals(testvar, 'clip2_var');
check_equals(testvar2, 'global_var');
setTarget("");