diff options
Diffstat (limited to 'gjs/byteArray.c')
| -rw-r--r-- | gjs/byteArray.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/gjs/byteArray.c b/gjs/byteArray.c index 4597d687..1145b9e5 100644 --- a/gjs/byteArray.c +++ b/gjs/byteArray.c @@ -910,10 +910,14 @@ static JSFunctionSpec gjs_byte_array_module_funcs[] = { }; JSBool -gjs_define_byte_array_stuff(JSContext *context, - JSObject *in_object) +gjs_define_byte_array_stuff(JSContext *context, + JSObject **module_out) { - gjs_byte_array_prototype = JS_InitClass(context, in_object, + JSObject *module; + + module = JS_NewObject (context, NULL, NULL, NULL); + + gjs_byte_array_prototype = JS_InitClass(context, module, NULL, &gjs_byte_array_class, gjs_byte_array_constructor, @@ -926,8 +930,9 @@ gjs_define_byte_array_stuff(JSContext *context, if (gjs_byte_array_prototype == NULL) return JS_FALSE; - if (!JS_DefineFunctions(context, in_object, &gjs_byte_array_module_funcs[0])) + if (!JS_DefineFunctions(context, module, &gjs_byte_array_module_funcs[0])) return JS_FALSE; + *module_out = module; return JS_TRUE; } |
