[gjs] gjs: handle namespaces correctly when looking up native modules



commit 79e5160439afdebc2001b7d7197e99c27d063a05
Author: Tommi Komulainen <tko litl com>
Date:   Fri Jan 7 11:20:43 2011 +0000

    gjs: handle namespaces correctly when looking up native modules
    
    That is, look up 'imports.test.testNative' correctly as registered.
    
    Previously the dots were lost and while the module was registered as
    'test.testNative' it was looked up as 'testtestNative' which was not
    found:
    
    JS ERROR: !!!   Exception was: Error: No native module 'testtestNative' has registered itself
    
    https://bugzilla.gnome.org/show_bug.cgi?id=639164

 gjs/native.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
---
diff --git a/gjs/native.c b/gjs/native.c
index c2d49f9..1bb4faa 100644
--- a/gjs/native.c
+++ b/gjs/native.c
@@ -118,6 +118,7 @@ lookup_native_module(JSContext  *context,
 
         name = get_module_name(context, parent, &tmp);
         if (name != NULL) {
+            g_string_prepend_c(module_id, '.');
             g_string_prepend(module_id, name);
         }
 



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