Subject: [gjs/wip/ptomato/mozjs38: 7/17] js: Adapt to
new JS_SetErrorReporter() API



commit 4d0f4988464f4277153ff3935134375f65004bbc
Author: Philip Chimento <[email protected]>
Date: Wed Jan 11 23:13:44 2017 -0800

js: Adapt to new JS_SetErrorReporter() API

JS_SetErrorReporter() now acts on a JSRuntime, not a JSContext.
(JSRuntime and JSContext will be merged in a future version of
SpiderMonkey anyway.)

gjs/jsapi-util.cpp | 2 --
gjs/runtime.cpp | 1 +
modules/console.cpp | 2 +-
test/gjs-test-utils.cpp | 2 +-
4 files changed, 3 insertions(+), 4 deletions(-)
---
diff --git a/gjs/jsapi-util.cpp b/gjs/jsapi-util.cpp
index 114a72b..51300ef 100644
--- a/gjs/jsapi-util.cpp
+++ b/gjs/jsapi-util.cpp
@@ -100,8 +100,6 @@ gjs_init_context_standard (JSContext *context,
.setAsmJS(true);
}

- JS_SetErrorReporter(context, gjs_error_reporter);
-
compartment_options.setVersion(JSVERSION_LATEST);
global.set(JS_NewGlobalObject(context, &global_class, NULL,
JS::FireOnNewGlobalHook,
compartment_options));
diff --git a/gjs/runtime.cpp b/gjs/runtime.cpp
index 816dbce..5ae5397 100644
--- a/gjs/runtime.cpp
+++ b/gjs/runtime.cpp
@@ -270,6 +270,7 @@ gjs_runtime_for_current_thread(void)
JS_SetGCParameter(runtime, JSGC_MAX_BYTES, 0xffffffff);
JS_SetLocaleCallbacks(runtime, &gjs_locale_callbacks);
JS_SetFinalizeCallback(runtime, gjs_finalize_callback);
+ JS_SetErrorReporter(runtime, gjs_error_reporter);

g_private_set(&thread_runtime, runtime);
}
diff --git a/modules/console.cpp b/modules/console.cpp
index b746136..60f095b 100644
--- a/modules/console.cpp
+++ b/modules/console.cpp
@@ -169,7 +169,7 @@ gjs_console_interact(JSContext *context,
int startline;
FILE *file = stdin;

- JS_SetErrorReporter(context, gjs_console_error_reporter);
+ JS_SetErrorReporter(JS_GetRuntime(context), gjs_console_error_reporter);

/* It's an interactive filehandle; drop into read-eval-print loop. */
lineno = 1;
diff --git a/test/gjs-test-utils.cpp b/test/gjs-test-utils.cpp
index 7ed2afd..f6e4f4b 100644
--- a/test/gjs-test-utils.cpp
+++ b/test/gjs-test-utils.cpp
@@ -58,7 +58,7 @@ gjs_unit_test_fixture_setup(GjsUnitTestFixture *fx,

/* This is for shoving private data into the error reporter callback */
g_object_set_data(G_OBJECT(fx->gjs_context), "test fixture", fx);
- JS_SetErrorReporter(fx->cx, test_error_reporter);
+ JS_SetErrorReporter(JS_GetRuntime(fx->cx), test_error_reporter);

JS_BeginRequest(fx->cx);

_______________________________________________
commits-list mailing list (read only)
https://mail.gnome.org/mailman/listinfo/commits-list

Want to limit the commits to a few modules? Go to above URL, log in to edit
your options and select the modules ('topics') you want.



Programming list archiving by: Enterprise Git Hosting