gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] gnash ChangeLog server/as_function.cpp


From: Sandro Santilli
Subject: [Gnash-commit] gnash ChangeLog server/as_function.cpp
Date: Mon, 05 May 2008 17:14:53 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Sandro Santilli <strk>  08/05/05 17:14:52

Modified files:
        .              : ChangeLog 
        server         : as_function.cpp 

Log message:
        catch exception thrown by native functions.
        Most will trhow an exception when 'this' is undefined
        (example: a=new String.prototype.substring).

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.6507&r2=1.6508
http://cvs.savannah.gnu.org/viewcvs/gnash/server/as_function.cpp?cvsroot=gnash&r1=1.59&r2=1.60

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.6507
retrieving revision 1.6508
diff -u -b -r1.6507 -r1.6508
--- ChangeLog   5 May 2008 16:58:49 -0000       1.6507
+++ ChangeLog   5 May 2008 17:14:50 -0000       1.6508
@@ -1,5 +1,11 @@
 2008-05-05 Sandro Santilli <address@hidden>
 
+       * server/as_function.cpp (constructInstance): catch exception
+         thrown by native functions. Most will trhow an exception when
+         'this' is undefined (example: a=new String.prototype.substring).
+
+2008-05-05 Sandro Santilli <address@hidden>
+
        * server/asobj/gen-asclass.pl: add support for static methods and
          properties.
        * doc/C/NOTES: add note about static props and methods in the new

Index: server/as_function.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/as_function.cpp,v
retrieving revision 1.59
retrieving revision 1.60
diff -u -b -r1.59 -r1.60
--- server/as_function.cpp      21 Apr 2008 11:27:42 -0000      1.59
+++ server/as_function.cpp      5 May 2008 17:14:52 -0000       1.60
@@ -386,7 +386,12 @@
                );
 
                fn_call fn(NULL, &env, nargs, first_arg_index);
+               try {
                newobj = call(fn).to_object();
+               } catch (std::exception& ex) {
+                       log_debug("Native function called as constructor 
returned %s", ex.what());
+                       newobj = new as_object();
+               }
                assert(newobj); // we assume builtin functions do return 
objects !!
 
                // Add a __constructor__ member to the new object, but only for 
SWF6 up




reply via email to

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