gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-commit] gnash ChangeLog server/asobj/AsBroadcaster.cpp ...


From: Sandro Santilli
Subject: [Gnash-commit] gnash ChangeLog server/asobj/AsBroadcaster.cpp ...
Date: Tue, 17 Jun 2008 18:05:43 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Sandro Santilli <strk>  08/06/17 18:05:43

Modified files:
        .              : ChangeLog 
        server/asobj   : AsBroadcaster.cpp 
        server/vm      : ASHandlers.cpp 
        testsuite/actionscript.all: AsBroadcaster.as 

Log message:
        * testsuite/actionscript.all/AsBroadcaster.as: add test for 'super'
          referenced in AsBroadcaster event handlers.
        * server/vm/ASHandlers.cpp (ActionCallMethod): don't dereference
          null prototypes...
        * server/asobj/AsBroadcaster.cpp: add initial support for 'super'
          in AsBroadcasters (I now realized I forgot to cleanup the
          super stuff, and it hurts indeed!).

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.6963&r2=1.6964
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/AsBroadcaster.cpp?cvsroot=gnash&r1=1.15&r2=1.16
http://cvs.savannah.gnu.org/viewcvs/gnash/server/vm/ASHandlers.cpp?cvsroot=gnash&r1=1.252&r2=1.253
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/actionscript.all/AsBroadcaster.as?cvsroot=gnash&r1=1.9&r2=1.10

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.6963
retrieving revision 1.6964
diff -u -b -r1.6963 -r1.6964
--- ChangeLog   17 Jun 2008 17:32:03 -0000      1.6963
+++ ChangeLog   17 Jun 2008 18:05:40 -0000      1.6964
@@ -1,3 +1,13 @@
+2008-06-17 Sandro Santilli <address@hidden>
+
+       * testsuite/actionscript.all/AsBroadcaster.as: add test for 'super'
+         referenced in AsBroadcaster event handlers.
+       * server/vm/ASHandlers.cpp (ActionCallMethod): don't dereference
+         null prototypes...
+       * server/asobj/AsBroadcaster.cpp: add initial support for 'super'
+         in AsBroadcasters (I now realized I forgot to cleanup the
+         super stuff, and it hurts indeed!).
+
 2008-06-17 Bastiaan Jacques <address@hidden>
 
        * gui/gtk_glue_agg.cpp: Make sure we don't overflow the buffer.

Index: server/asobj/AsBroadcaster.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/AsBroadcaster.cpp,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -b -r1.15 -r1.16
--- server/asobj/AsBroadcaster.cpp      25 May 2008 10:05:22 -0000      1.15
+++ server/asobj/AsBroadcaster.cpp      17 Jun 2008 18:05:41 -0000      1.16
@@ -75,8 +75,31 @@
                boost::intrusive_ptr<as_object> o = v.to_object();
                if ( ! o ) return;
 
+#if 1 // oh boy.. I forgot to clean the "super" stuff up :! TODO: make 
fetching super easier...
+               as_object* super = NULL;
+               as_object* owner = NULL;
+               Property* p = o->findProperty(_eventName, 0, &owner);
+               if ( ! p )
+               {
+                       //log_debug("Object %p has no event handler named %s", 
o, VM::get().getStringTable().value(_eventName));
+                       // Older code used to increment this even when method
+                       // was not found, so I guess we'll do the same..
+                       ++_dispatched;
+                       return;
+               }
+               if ( o->isSuper() )
+               {
+                       log_unimpl("Getting super from a super in 
AsBroadcaster");
+               }
+               super = owner->get_super();
+               as_value method = p->getValue(*o);
+
+               _fn.super = super;
+               //log_debug("AsBroadcaster calling function with super %p", 
super);
+#else
                as_value method;
                o->get_member(_eventName, &method);
+#endif
 
                if ( method.is_function() )
                {

Index: server/vm/ASHandlers.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/vm/ASHandlers.cpp,v
retrieving revision 1.252
retrieving revision 1.253
diff -u -b -r1.252 -r1.253
--- server/vm/ASHandlers.cpp    17 Jun 2008 11:34:59 -0000      1.252
+++ server/vm/ASHandlers.cpp    17 Jun 2008 18:05:42 -0000      1.253
@@ -3470,7 +3470,7 @@
                     }
                 }
             }
-            super = proto->get_super();
+            super = proto ? proto->get_super() : 0;
         }
         else
         {

Index: testsuite/actionscript.all/AsBroadcaster.as
===================================================================
RCS file: /sources/gnash/gnash/testsuite/actionscript.all/AsBroadcaster.as,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -b -r1.9 -r1.10
--- testsuite/actionscript.all/AsBroadcaster.as 11 Mar 2008 19:31:46 -0000      
1.9
+++ testsuite/actionscript.all/AsBroadcaster.as 17 Jun 2008 18:05:42 -0000      
1.10
@@ -20,7 +20,7 @@
 // execute it like this gnash -1 -r 0 -v out.swf
 
 
-rcsid="$Id: AsBroadcaster.as,v 1.9 2008/03/11 19:31:46 strk Exp $";
+rcsid="$Id: AsBroadcaster.as,v 1.10 2008/06/17 18:05:42 strk Exp $";
 #include "check.as"
 
 #if OUTPUT_VERSION < 6
@@ -32,6 +32,8 @@
 xcheck_equals(typeof(AsBroadcaster.prototype), 'undefined'); 
 check_equals(typeof(AsBroadcaster.initialize), 'undefined');
 
+check_totals(3);
+
 #else // OUTPUT_VERSION >= 6
 
 check_equals(typeof(AsBroadcaster), 'function'); // ???
@@ -273,6 +275,27 @@
 bcast.broadcastMessage('setSum', 'one', 'two', 'three');
 check_equals(_root.total, '0onetwothree');
 
+//--------------------------------
+// event handlers calling super
+//--------------------------------
+
+function A1() {}
+A1.prototype.add = function(o) { o.msg += 'A'; };
+function B1() {}
+B1.prototype = new A1;
+B1.prototype.add = function(o) { super.add(o); o.msg += 'B'; };
+
+bobj = new B1;
+o = { msg:'' };
+bobj.add(o);
+check_equals(o.msg, "AB");
+o.msg = '';
+
+bcast._listeners.length=0;
+bcast.addListener(bobj);
+bcast.broadcastMessage('add', o);
+check_equals(o.msg, "AB");
+
 
//-----------------------------------------------------------------------------------
 // TODO: test override of 
AsBroadcaster.{addListener,removeListener,broadcastMessage}
 // swfdec contains tests for this, which should now be pretty succeeding 
except for
@@ -281,6 +304,6 @@
 // See swfdec/test/trace/asbroadcaster-override.as for more info
 
//-----------------------------------------------------------------------------------
 
-#endif // OUTPUT_VERSION >= 6
+check_totals(108);
 
-totals();
+#endif // OUTPUT_VERSION < 6




reply via email to

[Prev in Thread] Current Thread [Next in Thread]