seed r352 - trunk/libseed
- From: racarr svn gnome org
- To: svn-commits-list gnome org
- Subject: seed r352 - trunk/libseed
- Date: Tue, 25 Nov 2008 07:05:09 +0000 (UTC)
Author: racarr
Date: Tue Nov 25 07:05:09 2008
New Revision: 352
URL: http://svn.gnome.org/viewvc/seed?rev=352&view=rev
Log:
seed-structs is global context free!
Modified:
trunk/libseed/seed-engine.c
trunk/libseed/seed-structs.c
trunk/libseed/seed-structs.h
trunk/libseed/seed-types.c
Modified: trunk/libseed/seed-engine.c
==============================================================================
--- trunk/libseed/seed-engine.c (original)
+++ trunk/libseed/seed-engine.c Tue Nov 25 07:05:09 2008
@@ -69,7 +69,7 @@
}
parameters = (JSObjectRef)arguments[0];
}
- ret = seed_construct_struct_type_with_parameters(info,
+ ret = seed_construct_struct_type_with_parameters(ctx, info,
parameters,
exception);
Modified: trunk/libseed/seed-structs.c
==============================================================================
--- trunk/libseed/seed-structs.c (original)
+++ trunk/libseed/seed-structs.c Tue Nov 25 07:05:09 2008
@@ -490,7 +490,8 @@
}
JSObjectRef
-seed_construct_struct_type_with_parameters(GIBaseInfo * info,
+seed_construct_struct_type_with_parameters(JSContextRef ctx,
+ GIBaseInfo * info,
JSObjectRef parameters,
JSValueRef * exception)
{
@@ -518,16 +519,16 @@
object = g_slice_alloc0(size);
if (type == GI_INFO_TYPE_STRUCT)
- ret = seed_make_struct(eng->context, object, info);
+ ret = seed_make_struct(ctx, object, info);
else
- ret = seed_make_union(eng->context, object, info);
+ ret = seed_make_union(ctx, object, info);
- seed_pointer_set_free(eng->context, ret, TRUE);
+ seed_pointer_set_free(ctx, ret, TRUE);
if (!parameters)
return ret;
- jsprops = JSObjectCopyPropertyNames(eng->context,
+ jsprops = JSObjectCopyPropertyNames(ctx,
(JSObjectRef)parameters);
nparams = JSPropertyNameArrayGetCount(jsprops);
@@ -551,15 +552,15 @@
gchar *mes =
g_strdup_printf("Invalid property for construction: %s",
prop_name);
- seed_make_exception(eng->context, exception, "PropertyError", mes);
+ seed_make_exception(ctx, exception, "PropertyError", mes);
g_free(mes);
- return (JSObjectRef) JSValueMakeNull(eng->context);
+ return (JSObjectRef) JSValueMakeNull(ctx);
}
field_type = g_field_info_get_type(field);
- jsprop_value = JSObjectGetProperty(eng->context,
+ jsprop_value = JSObjectGetProperty(ctx,
(JSObjectRef)parameters,
jsprop_name, NULL);
Modified: trunk/libseed/seed-structs.h
==============================================================================
--- trunk/libseed/seed-structs.h (original)
+++ trunk/libseed/seed-structs.h Tue Nov 25 07:05:09 2008
@@ -49,7 +49,8 @@
gchar * field_name);
JSObjectRef
-seed_construct_struct_type_with_parameters(GIBaseInfo * info,
+seed_construct_struct_type_with_parameters(JSContextRef ctx,
+ GIBaseInfo * info,
JSObjectRef parameters,
JSValueRef * exception);
Modified: trunk/libseed/seed-types.c
==============================================================================
--- trunk/libseed/seed-types.c (original)
+++ trunk/libseed/seed-types.c Tue Nov 25 07:05:09 2008
@@ -323,6 +323,7 @@
{
JSObjectRef strukt =
seed_construct_struct_type_with_parameters(
+ eng->context,
interface, (JSObjectRef)value, exception);
arg->v_pointer = seed_pointer_get_pointer(eng->context,
strukt);
@@ -779,7 +780,9 @@
if (!info)
return FALSE;
- new_struct = seed_construct_struct_type_with_parameters(info,
+ new_struct =
+ seed_construct_struct_type_with_parameters(eng->context,
+ info,
(JSObjectRef)val,
exception);
p = seed_pointer_get_pointer(eng->context, new_struct);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]