[gjs/mozjs78: 15/23] engine: Update hook signatures. - Unhandled promises now have a mute flag. - Garbage collection now
- From: Evan Welsh <ewlsh src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gjs/mozjs78: 15/23] engine: Update hook signatures. - Unhandled promises now have a mute flag. - Garbage collection now
- Date: Sun, 5 Jul 2020 03:40:45 +0000 (UTC)
commit c3b94fe6b25da31399564851d09ff23f8efcae34
Author: Evan Welsh <noreply evanwelsh com>
Date: Sat Jul 4 22:23:39 2020 -0500
engine: Update hook signatures.
- Unhandled promises now have a mute flag.
- Garbage collection now specifies the reason/source.
gjs/engine.cpp | 5 +++--
test/gjs-test-rooting.cpp | 2 +-
2 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/gjs/engine.cpp b/gjs/engine.cpp
index 7572ca9e..926c7bf3 100644
--- a/gjs/engine.cpp
+++ b/gjs/engine.cpp
@@ -102,7 +102,8 @@ static void gjs_finalize_callback(JSFreeOp*, JSFinalizeStatus status,
gjs->set_sweeping(false);
}
-static void on_garbage_collect(JSContext*, JSGCStatus status, void*) {
+static void on_garbage_collect(JSContext*, JSGCStatus status, JS::GCReason,
+ void*) {
/* We finalize any pending toggle refs before doing any garbage collection,
* so that we can collect the JS wrapper objects, and in order to minimize
* the chances of objects having a pending toggle up queued when they are
@@ -116,7 +117,7 @@ static void on_garbage_collect(JSContext*, JSGCStatus status, void*) {
}
static void on_promise_unhandled_rejection(
- JSContext* cx, JS::HandleObject promise,
+ JSContext* cx, bool, JS::HandleObject promise,
JS::PromiseRejectionHandlingState state, void* data) {
auto gjs = static_cast<GjsContextPrivate*>(data);
uint64_t id = JS::GetPromiseID(promise);
diff --git a/test/gjs-test-rooting.cpp b/test/gjs-test-rooting.cpp
index 3dfa4cd4..a6854e64 100644
--- a/test/gjs-test-rooting.cpp
+++ b/test/gjs-test-rooting.cpp
@@ -55,7 +55,7 @@ test_obj_new(GjsRootingFixture *fx)
return retval;
}
-static void on_gc(JSContext*, JSGCStatus status, void*) {
+static void on_gc(JSContext*, JSGCStatus status, JS::GCReason, void*) {
if (status != JSGC_END)
return;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]