[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: |
Thu, 05 Apr 2007 19:33:54 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Changes by: Sandro Santilli <strk> 07/04/05 19:33:54
Modified files:
. : ChangeLog
server/vm : ASHandlers.cpp
testsuite/actionscript.all: MovieClip.as
Log message:
* server/vm/ASHandlers.cpp (ActionRemoveClip): properly parse
the given argument rather then assuming that it refers to
a child of the current target movie. (fixes the softreference
tests).
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.2792&r2=1.2793
http://cvs.savannah.gnu.org/viewcvs/gnash/server/vm/ASHandlers.cpp?cvsroot=gnash&r1=1.81&r2=1.82
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/actionscript.all/MovieClip.as?cvsroot=gnash&r1=1.42&r2=1.43
Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.2792
retrieving revision 1.2793
diff -u -b -r1.2792 -r1.2793
--- ChangeLog 5 Apr 2007 17:40:39 -0000 1.2792
+++ ChangeLog 5 Apr 2007 19:33:53 -0000 1.2793
@@ -1,5 +1,9 @@
2007-04-05 Sandro Santilli <address@hidden>
+ * server/vm/ASHandlers.cpp (ActionRemoveClip): properly parse
+ the given argument rather then assuming that it refers to
+ a child of the current target movie. (fixes the softreference
+ tests).
* testsuite/actionscript.all/MovieClip.as: add softreference
test (MovieClip values kept by absolute _target).
* testsuite/actionscript.all/MovieClip.as: fix couple of stack
Index: server/vm/ASHandlers.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/vm/ASHandlers.cpp,v
retrieving revision 1.81
retrieving revision 1.82
diff -u -b -r1.81 -r1.82
--- server/vm/ASHandlers.cpp 5 Apr 2007 11:16:11 -0000 1.81
+++ server/vm/ASHandlers.cpp 5 Apr 2007 19:33:54 -0000 1.82
@@ -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.81 2007/04/05 11:16:11 strk Exp $ */
+/* $Id: ASHandlers.cpp,v 1.82 2007/04/05 19:33:54 strk Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -1169,12 +1169,34 @@
thread.ensureStack(1);
- sprite_instance* tgt = env.get_target()->to_movie();
- assert(tgt);
+ std::string path = env.pop().to_std_string();
+
+ character* ch = env.find_target(path);
+ if ( ! ch )
+ {
+ IF_VERBOSE_ASCODING_ERRORS(
+ log_aserror("Path given to removeMovieClip(%s) doesn't point to
a character",
+ path.c_str());
+ );
+ return;
+ }
+
+ sprite_instance* sprite = ch->to_movie();
+ if ( ! sprite )
+ {
+ IF_VERBOSE_ASCODING_ERRORS(
+ log_aserror("Path given to removeMovieClip(%s) is not a sprite",
+ path.c_str());
+ );
+ return;
+ }
+
+ sprite_instance* parent =
dynamic_cast<sprite_instance*>(sprite->get_parent());
+ if (parent)
+ {
+ parent->remove_display_object(sprite->get_depth(), 0);
+ }
- // strk: why not using pop() ?
- tgt->remove_display_object(env.top(0).to_tu_string());
- env.drop(1);
}
/// \brief Trace messages from the Flash movie using trace();
Index: testsuite/actionscript.all/MovieClip.as
===================================================================
RCS file: /sources/gnash/gnash/testsuite/actionscript.all/MovieClip.as,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -b -r1.42 -r1.43
--- testsuite/actionscript.all/MovieClip.as 5 Apr 2007 17:40:39 -0000
1.42
+++ testsuite/actionscript.all/MovieClip.as 5 Apr 2007 19:33:54 -0000
1.43
@@ -22,7 +22,7 @@
// compile this test case with Ming makeswf, and then
// execute it like this gnash -1 -r 0 -v out.swf
-rcsid="$Id: MovieClip.as,v 1.42 2007/04/05 17:40:39 strk Exp $";
+rcsid="$Id: MovieClip.as,v 1.43 2007/04/05 19:33:54 strk Exp $";
#include "check.as"
@@ -275,24 +275,29 @@
//--------------------------------------------------------------------------
// Test "soft" references
-// See: // http://thread.gmane.org/gmane.comp.web.flashcoders.devel/84030
+// See http://thread.gmane.org/gmane.comp.web.flashcoders.devel/84030
//--------------------------------------------------------------------------
#if OUTPUT_VERSION >= 6
+
softref = _root.createEmptyMovieClip("hardref", 60);
check_equals(typeof(hardref), 'movieclip');
check_equals(typeof(softref), 'movieclip');
softref.member = 1;
check_equals(typeof(softref.member), 'number');
check_equals(softref.member, 1);
-removeMovieClip(hardref); // use the _global removeMovieClip !
-xcheck_equals(typeof(hardref), 'undefined');
+removeMovieClip(hardref); // using ActionRemoveClip (0x25)
+//_global.removeMovieClip(softref); // using the _global removeMovieClip
+//hardref.removeMovieClip(); // using the sprite's removeMovieClip
+//softref.removeMovieClip(); // use the softref's removeMovieClip
+check_equals(typeof(hardref), 'undefined');
check_equals(typeof(softref), 'movieclip');
-xcheck_equals(typeof(softref.member), 'undefined');
-_root.createEmptyMovieClip("hardref", 60);
+check_equals(typeof(softref.member), 'undefined');
+_root.createEmptyMovieClip("hardref", 61);
hardref.member = 2;
check_equals(typeof(softref.member), 'number');
check_equals(softref.member, 2);
+
#endif // OUTPUT_VERSION >= 6
//----------------------------------------------
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gnash-commit] gnash ChangeLog server/vm/ASHandlers.cpp testsu...,
Sandro Santilli <=