[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] gnash ChangeLog server/as_function.cpp server/b...
From: |
Sandro Santilli |
Subject: |
[Gnash-commit] gnash ChangeLog server/as_function.cpp server/b... |
Date: |
Sun, 30 Mar 2008 12:55:48 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Changes by: Sandro Santilli <strk> 08/03/30 12:55:48
Modified files:
. : ChangeLog
server : as_function.cpp builtin_function.h
server/asobj : ClassHierarchy.cpp
testsuite/actionscript.all: MovieClip.as Object.as String.as
Log message:
Set functions 'constructor' property to Function.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.6088&r2=1.6089
http://cvs.savannah.gnu.org/viewcvs/gnash/server/as_function.cpp?cvsroot=gnash&r1=1.52&r2=1.53
http://cvs.savannah.gnu.org/viewcvs/gnash/server/builtin_function.h?cvsroot=gnash&r1=1.15&r2=1.16
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/ClassHierarchy.cpp?cvsroot=gnash&r1=1.9&r2=1.10
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/actionscript.all/MovieClip.as?cvsroot=gnash&r1=1.121&r2=1.122
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/actionscript.all/Object.as?cvsroot=gnash&r1=1.48&r2=1.49
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/actionscript.all/String.as?cvsroot=gnash&r1=1.49&r2=1.50
Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.6088
retrieving revision 1.6089
diff -u -b -r1.6088 -r1.6089
--- ChangeLog 29 Mar 2008 23:41:04 -0000 1.6088
+++ ChangeLog 30 Mar 2008 12:55:46 -0000 1.6089
@@ -1,3 +1,11 @@
+2008-03-30 Sandro Santilli <address@hidden>
+
+ * server/as_function.cpp, server/builtin_function.h
+ server/asobj/ClassHierarchy.cpp: have function's
+ constructor property set to Function.
+ * testsuite/actionscript.all/: MovieClip.as, Object.as,
+ String.as: more constructors tests.
+
2008-03-29 Sandro Santilli <address@hidden>
* server/vm/ASHandlers.cpp (ActionSubString): don't choke on empty
Index: server/as_function.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/as_function.cpp,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -b -r1.52 -r1.53
--- server/as_function.cpp 29 Mar 2008 22:04:00 -0000 1.52
+++ server/as_function.cpp 30 Mar 2008 12:55:47 -0000 1.53
@@ -73,8 +73,13 @@
static boost::intrusive_ptr<as_object> proto;
if ( proto.get() == NULL ) {
+
// Initialize Function prototype
- proto = new as_object(getObjectInterface());
+ proto = new as_object();
+
+ //
+ proto->set_prototype(getObjectInterface());
+
VM::get().addStatic(proto.get());
if ( VM::get().getSWFVersion() >= 6 )
@@ -172,7 +177,8 @@
{
func = new builtin_function(
function_ctor, // function constructor doesn't do
anything
- getFunctionPrototype() // exported interface
+ getFunctionPrototype(), // exported interface
+ true // use "this" as constructor
);
VM::get().addStatic(func.get());
}
Index: server/builtin_function.h
===================================================================
RCS file: /sources/gnash/gnash/server/builtin_function.h,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -b -r1.15 -r1.16
--- server/builtin_function.h 27 Mar 2008 10:50:14 -0000 1.15
+++ server/builtin_function.h 30 Mar 2008 12:55:47 -0000 1.16
@@ -47,7 +47,7 @@
as_function(),
_func(func)
{
- init_member("constructor", this);
+ init_member("constructor",
as_function::getFunctionConstructor().get());
}
/// Construct a builtin function/class with the given interface
(possibly none)
@@ -63,13 +63,20 @@
/// provided. Use the constructor taking a single argument
/// to get a default interface instead.
///
- builtin_function(as_c_function_ptr func, as_object* iface)
+ builtin_function(as_c_function_ptr func, as_object* iface, bool
useThisAsCtor=false)
:
as_function(iface),
_func(func)
{
+ if ( useThisAsCtor )
+ {
init_member("constructor", this);
}
+ else
+ {
+ init_member("constructor",
as_function::getFunctionConstructor().get());
+ }
+ }
/// Invoke this function or this Class constructor
virtual as_value operator()(const fn_call& fn)
Index: server/asobj/ClassHierarchy.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/ClassHierarchy.cpp,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -b -r1.9 -r1.10
--- server/asobj/ClassHierarchy.cpp 21 Jan 2008 20:55:54 -0000 1.9
+++ server/asobj/ClassHierarchy.cpp 30 Mar 2008 12:55:48 -0000 1.10
@@ -84,7 +84,7 @@
as_function(getObjectInterface()),
mDeclaration(c), mTarget(g), mExtension(e)
{
- init_member("constructor", this);
+ init_member("constructor",
as_function::getFunctionConstructor().get());
}
virtual as_value operator()(const fn_call& /*fn*/)
@@ -141,7 +141,8 @@
as_function(getObjectInterface()),
mDeclaration(c), mTarget(g), mExtension(e)
{
- init_member("constructor", this);
+ //init_member("constructor", this);
+ init_member("constructor",
as_function::getFunctionConstructor().get());
}
virtual as_value operator()(const fn_call& /*fn*/)
Index: testsuite/actionscript.all/MovieClip.as
===================================================================
RCS file: /sources/gnash/gnash/testsuite/actionscript.all/MovieClip.as,v
retrieving revision 1.121
retrieving revision 1.122
diff -u -b -r1.121 -r1.122
--- testsuite/actionscript.all/MovieClip.as 29 Mar 2008 15:41:43 -0000
1.121
+++ testsuite/actionscript.all/MovieClip.as 30 Mar 2008 12:55:48 -0000
1.122
@@ -20,9 +20,9 @@
// 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.121 2008/03/29 15:41:43 strk Exp $";
+rcsid="$Id: MovieClip.as,v 1.122 2008/03/30 12:55:48 strk Exp $";
-rcsid="$Id: MovieClip.as,v 1.121 2008/03/29 15:41:43 strk Exp $";
+rcsid="$Id: MovieClip.as,v 1.122 2008/03/30 12:55:48 strk Exp $";
#include "check.as"
// To be called at end of test
@@ -104,12 +104,7 @@
check_equals(typeof(mc.meth), 'function');
check_equals(typeof(mc.getSWFVersion), 'function');
check_equals(mc.getSWFVersion(), OUTPUT_VERSION);
-
-#if OUTPUT_VERSION > 5
- xcheck_equals(MovieClip.constructor, Function);
-#else
- check_equals(MovieClip.constructor, Function);
-#endif
+check_equals(MovieClip.constructor, Function);
#if OUTPUT_VERSION >= 6
check(MovieClip.prototype.hasOwnProperty('loadMovie'));
Index: testsuite/actionscript.all/Object.as
===================================================================
RCS file: /sources/gnash/gnash/testsuite/actionscript.all/Object.as,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -b -r1.48 -r1.49
--- testsuite/actionscript.all/Object.as 29 Mar 2008 15:41:43 -0000
1.48
+++ testsuite/actionscript.all/Object.as 30 Mar 2008 12:55:48 -0000
1.49
@@ -21,7 +21,7 @@
// execute it like this gnash -1 -r 0 -v out.swf
-rcsid="$Id: Object.as,v 1.48 2008/03/29 15:41:43 strk Exp $";
+rcsid="$Id: Object.as,v 1.49 2008/03/30 12:55:48 strk Exp $";
#include "check.as"
// Test existance of methods
@@ -37,7 +37,7 @@
check_equals(Object.prototype.constructor, Object);
check_equals(typeof(Object.prototype.toString.constructor), 'function');
#if OUTPUT_VERSION > 5
- xcheck_equals(Object.prototype.toString.constructor, Function);
+ check_equals(Object.prototype.toString.constructor, Function);
check(Object.prototype.hasOwnProperty('toString'));
check(Object.prototype.hasOwnProperty('toLocaleString'));
check(Object.prototype.hasOwnProperty('valueOf'));
@@ -103,7 +103,7 @@
check(O.prototype.constructor.hasOwnProperty('prototype'));
check_equals(O.prototype.constructor, Object);
-xcheck_equals(O.constructor, Function);
+check_equals(O.constructor, Function);
check_equals(typeof(Object.prototype.addProperty), 'function');
check_equals(typeof(Object.prototype.hasOwnProperty), 'function');
Index: testsuite/actionscript.all/String.as
===================================================================
RCS file: /sources/gnash/gnash/testsuite/actionscript.all/String.as,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -b -r1.49 -r1.50
--- testsuite/actionscript.all/String.as 29 Mar 2008 23:41:05 -0000
1.49
+++ testsuite/actionscript.all/String.as 30 Mar 2008 12:55:48 -0000
1.50
@@ -17,7 +17,7 @@
// Original author: Mike Carlson - June 19th, 2006
-rcsid="$Id: String.as,v 1.49 2008/03/29 23:41:05 strk Exp $";
+rcsid="$Id: String.as,v 1.50 2008/03/30 12:55:48 strk Exp $";
#include "check.as"
check_equals(typeof(String), 'function');
@@ -61,6 +61,7 @@
check(String.hasOwnProperty('fromCharCode'));
check(!String.hasOwnProperty('toString'));
check(!String.hasOwnProperty('valueOf'));
+check(String.hasOwnProperty('__proto__'));
check(String.prototype.hasOwnProperty('valueOf'));
check(String.prototype.hasOwnProperty('toString'));
check(String.prototype.hasOwnProperty('toUpperCase'));
@@ -758,5 +759,5 @@
#if OUTPUT_VERSION < 6
check_totals(204);
#else
- check_totals(234);
+ check_totals(235);
#endif
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gnash-commit] gnash ChangeLog server/as_function.cpp server/b...,
Sandro Santilli <=