[seed] Wheeeeeeeeeeeeeeeeeeeeeeeeeeeeee



commit bb31ba72f9704ae8aa03d56bd501e87d7ad4f971
Author: Robert Carr <racarr mireia (none)>
Date:   Mon Apr 13 18:10:56 2009 -0400

    Wheeeeeeeeeeeeeeeeeeeeeeeeeeeeee
---
 libseed/seed-importer.c |   18 +++++++++++++++---
 1 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/libseed/seed-importer.c b/libseed/seed-importer.c
index 8b05a03..b010a2c 100644
--- a/libseed/seed-importer.c
+++ b/libseed/seed-importer.c
@@ -376,7 +376,7 @@ seed_gi_importer_do_namespace (JSContextRef ctx,
   g_hash_table_insert (gi_imports, g_strdup(namespace), namespace_ref);
   
   jsextension = g_strdup_printf ("imports.extensions.%s",
-				namespace);
+				 namespace);
   extension_script = JSStringCreateWithUTF8CString (jsextension);
   JSEvaluateScript (ctx, extension_script, NULL, NULL, 0, NULL);
   JSStringRelease (extension_script);
@@ -393,6 +393,7 @@ seed_gi_importer_get_property (JSContextRef ctx,
 			       JSStringRef property_name, 
 			       JSValueRef *exception)
 {
+  JSObjectRef ret;
   guint len;
   gchar *prop;
   
@@ -400,14 +401,22 @@ seed_gi_importer_get_property (JSContextRef ctx,
   prop = g_alloca (len * sizeof (gchar));
   JSStringGetUTF8CString (property_name, prop, len);
   
+  SEED_NOTE (IMPORTER, "seed_gi_importer_get_property with %s", prop);
+  
   if (!strcmp(prop, "versions"))
     return gi_importer_versions;
   // Nasty hack
   else if (!strcmp(prop, "toString"))
     return 0;
+  if (!strcmp (prop, "valueOf")) // HACK
+    return NULL;
 
-  return seed_gi_importer_do_namespace (ctx, prop, exception);
-  
+
+  ret = seed_gi_importer_do_namespace (ctx, prop, exception);
+  SEED_NOTE (IMPORTER, "Result (%p) from attempting to import %s: %s",
+	     ret, prop, seed_value_to_string (ctx, ret, exception));
+
+  return ret;  
 }
 
 static void
@@ -795,6 +804,9 @@ void seed_initialize_importer(JSContextRef ctx,
   gi_importer = JSObjectMake (ctx, gi_importer_class, NULL);
   gi_importer_versions = JSObjectMake (ctx, NULL, NULL);
   
+  JSValueProtect (ctx, gi_importer);
+  JSValueProtect (ctx, gi_importer_versions);
+  
   importer_dir_class = JSClassCreate (&importer_dir_class_def);
   
   gi_imports = g_hash_table_new (g_str_hash, g_str_equal);



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