[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] gnash ChangeLog server/as_object.h server/vm/AS...
From: |
Sandro Santilli |
Subject: |
[Gnash-commit] gnash ChangeLog server/as_object.h server/vm/AS... |
Date: |
Wed, 12 Mar 2008 22:33:08 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Changes by: Sandro Santilli <strk> 08/03/12 22:33:08
Modified files:
. : ChangeLog
server : as_object.h
server/vm : ASHandlers.cpp
testsuite/actionscript.all: Inheritance.as
testsuite/swfdec: PASSING
Log message:
When SWF > 6 compute super from the actual object containing the named
property (in ActionCallMethod).
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.5890&r2=1.5891
http://cvs.savannah.gnu.org/viewcvs/gnash/server/as_object.h?cvsroot=gnash&r1=1.97&r2=1.98
http://cvs.savannah.gnu.org/viewcvs/gnash/server/vm/ASHandlers.cpp?cvsroot=gnash&r1=1.209&r2=1.210
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/actionscript.all/Inheritance.as?cvsroot=gnash&r1=1.49&r2=1.50
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/swfdec/PASSING?cvsroot=gnash&r1=1.101&r2=1.102
Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.5890
retrieving revision 1.5891
diff -u -b -r1.5890 -r1.5891
--- ChangeLog 12 Mar 2008 21:20:47 -0000 1.5890
+++ ChangeLog 12 Mar 2008 22:33:06 -0000 1.5891
@@ -1,5 +1,15 @@
2008-03-12 Sandro Santilli <address@hidden>
+ * testsuite/swfdec/PASSING: super-reference-{7,8} succeed.
+ * testsuite/actionscript.all/Inheritance.as: last failing test pass
+ (we need a lot more now !!)
+ * server/as_object.h: make findProperty public.
+ * server/vm/ASHandlers.cpp (ActionCallMethod): use findProperty
+ to find the actual object containing the named method to call,
+ and compute super from that IFF swf > 7.
+
+2008-03-12 Sandro Santilli <address@hidden>
+
* testsuite/swfdec/PASSING: super-reference-6.swf succeeds.
* server/as_function.cpp (function_call): set super.
* testsuite/actionscript.all/Stage.as: successes..
Index: server/as_object.h
===================================================================
RCS file: /sources/gnash/gnash/server/as_object.h,v
retrieving revision 1.97
retrieving revision 1.98
diff -u -b -r1.97 -r1.98
--- server/as_object.h 10 Mar 2008 23:23:10 -0000 1.97
+++ server/as_object.h 12 Mar 2008 22:33:07 -0000 1.98
@@ -101,6 +101,8 @@
Property* findUpdatableProperty(string_table::key name,
string_table::key nsname = 0);
+public:
+
/// Find a property scanning the inheritance chain
///
/// @param name
@@ -115,8 +117,6 @@
Property* findProperty(string_table::key name, string_table::key nsname,
as_object **owner = NULL);
-public:
-
/// \brief
/// Return a reference to the Virtual Machine that created
/// this object.
Index: server/vm/ASHandlers.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/vm/ASHandlers.cpp,v
retrieving revision 1.209
retrieving revision 1.210
diff -u -b -r1.209 -r1.210
--- server/vm/ASHandlers.cpp 11 Mar 2008 17:18:44 -0000 1.209
+++ server/vm/ASHandlers.cpp 12 Mar 2008 22:33:07 -0000 1.210
@@ -3430,15 +3430,12 @@
log_action(_(" method nargs: %d"), nargs);
);
- // TODO:
- // 1. if object/func is super keep current 'this' when calling the
method (don't pass 'super' as 'this')
- // 2. if object/func is super pass it over to the function being
invoked or it will create a new
- // super thus breaking the chain (use fn_call for that ?)
-
string method_string = method_name.to_string();
as_value method_val;
boost::intrusive_ptr<as_object> obj = obj_value.to_object();
+ bool hasMethodName = ( (!method_name.is_undefined()) &&
(!method_string.empty()) );
+
as_object* this_ptr = obj.get();
as_object* super = NULL;
if ( obj.get() )
@@ -3450,14 +3447,33 @@
}
else
{
- //log_debug("%p.%s() call", obj.get(),
method_string.c_str());
as_object* proto = obj->get_prototype().get();
+ as_object* owner = proto;
+ if ( hasMethodName )
+ {
+ VM& vm = VM::get();
+ if ( vm.getSWFVersion() > 6 )
+ {
+ string_table::key k =
vm.getStringTable().find(method_string);
+ Property* p = obj->findProperty(k, 0,
&owner);
+ if ( p )
+ {
+ assert(owner);
+ if ( owner != obj.get() )
+ {
+ proto = owner;
+ }
+ }
+ }
+ }
+
+ //log_debug("%p.%s() call", obj.get(),
method_string.c_str());
if ( proto ) super = proto->get_super();
else super = obj->get_super();
}
}
- if ( method_name.is_undefined() || method_string.empty() )
+ if ( ! hasMethodName )
{
// We'll be calling the super constructor here
method_val = obj_value;
Index: testsuite/actionscript.all/Inheritance.as
===================================================================
RCS file: /sources/gnash/gnash/testsuite/actionscript.all/Inheritance.as,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -b -r1.49 -r1.50
--- testsuite/actionscript.all/Inheritance.as 11 Mar 2008 19:31:47 -0000
1.49
+++ testsuite/actionscript.all/Inheritance.as 12 Mar 2008 22:33:07 -0000
1.50
@@ -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: Inheritance.as,v 1.49 2008/03/11 19:31:47 strk Exp $";
+rcsid="$Id: Inheritance.as,v 1.50 2008/03/12 22:33:07 strk Exp $";
#include "check.as"
check_equals(typeof(Object.prototype.constructor), 'function');
@@ -250,7 +250,7 @@
C.prototype = new B;
co = new C;
#if OUTPUT_VERSION > 6
- xcheck_equals(co.whoami(), "A.B"); // gnash fails returning A.B.B
+ check_equals(co.whoami(), "A.B"); // gnash fails returning A.B.B
#else
# if OUTPUT_VERSION == 6
check_equals(co.whoami(), "A.B.B");
Index: testsuite/swfdec/PASSING
===================================================================
RCS file: /sources/gnash/gnash/testsuite/swfdec/PASSING,v
retrieving revision 1.101
retrieving revision 1.102
diff -u -b -r1.101 -r1.102
--- testsuite/swfdec/PASSING 12 Mar 2008 21:20:48 -0000 1.101
+++ testsuite/swfdec/PASSING 12 Mar 2008 22:33:07 -0000 1.102
@@ -719,6 +719,8 @@
super-property-6.swf:7b606f24b21da8c389ccf9f3c8eea66e
super-property-7.swf:d31079db52dee599db902021f74f8394
super-reference-6.swf:cbcbc91f0d25eb0006989138840ce04c
+super-reference-7.swf:5720b0ec0fb4579d47afadb85eea8ab2
+super-reference-8.swf:c654701990094599225e48bfdb63c799
super-this-5.swf:0e68ec038aea019ba6434698eb61e31a
targetpath-5.swf:5af443c52767f4709305003a8d081ffc
targetpath-6.swf:100f7f5ac0740ce49f0a2dac8ee10ab8
- [Gnash-commit] gnash ChangeLog server/as_object.h server/vm/AS...,
Sandro Santilli <=