--- a/gjs/gplugin-gjs-loader.cc Mon Jun 05 23:30:04 2017 -0500
+++ b/gjs/gplugin-gjs-loader.cc Tue Jun 06 21:11:18 2017 -0500
@@ -174,7 +174,6 @@
context = gjs_context_new();
- g_message("Scope: %p", scope);
if(!_gplugin_gjs_loader_eval_file(context, &scope, filename, error)) {
g_object_unref(G_OBJECT(context));
@@ -185,18 +184,22 @@
jsctx = (JSContext *)gjs_context_get_native_context(context);
/* find the query function */
- query = gplugin_gjs_loader_find_function(jsctx, scope, "gplugin_query",
+ // query = gplugin_gjs_loader_find_function(jsctx, scope, "gplugin_query", + // g_message("query: %p", query); + // g_object_unref(G_OBJECT(context)); - g_message("query: %p", query);
- g_object_unref(G_OBJECT(context));
+ // g_message("querying plugin");
+ JS::AutoValueVector argv(jsctx); /* now call the query function */
- if(!JS_CallFunction(jsctx, scope, query, 0, NULL, &value)) {
+ if(!JS_CallFunctionName(jsctx, scope, "gplugin_query", 0, argv.begin(), &value)) { *error = g_error_new(GPLUGIN_DOMAIN, 0,
"Failed to call the query function");