seed r498 - trunk/libseed



Author: racarr
Date: Sat Dec 20 03:04:14 2008
New Revision: 498
URL: http://svn.gnome.org/viewvc/seed?rev=498&view=rev

Log:
Exceptions in ffi closures.

Modified:
   trunk/libseed/seed-closure.c

Modified: trunk/libseed/seed-closure.c
==============================================================================
--- trunk/libseed/seed-closure.c	(original)
+++ trunk/libseed/seed-closure.c	Sat Dec 20 03:04:14 2008
@@ -120,6 +120,7 @@
 	gint num_args, i;
 	JSValueRef *jsargs;
 	JSValueRef return_value;
+	JSValueRef exception = 0;
 	GITypeTag return_tag;
 	GIArgInfo *arg_info;
 	GITypeInfo *return_type;
@@ -241,7 +242,16 @@
 	return_value = (JSValueRef)
 		JSObjectCallAsFunction(ctx,
 							   (JSObjectRef) privates->function, 0,
-							   num_args, jsargs, 0);
+							   num_args, jsargs, &exception);
+	
+	if (exception)
+	{
+		gchar *mes = seed_exception_to_string(ctx, 
+											  exception);
+		g_warning("Exception in closure marshal. %s \n", mes, 0);
+		g_free(mes);
+		exception = 0;
+	}
 
 	g_free(jsargs);
 



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