[gjs/mozjs78: 11/22] engine: Update hook signatures.




commit 2ccb2dec45a4157d0a42afb08d55646364a46d10
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.
    
    See: GNOME/gjs#329

 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 f23c47d4..7b0cb14f 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 mutedErrors [[maybe_unused]], 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 3fa26cdc..141d479d 100644
--- a/test/gjs-test-rooting.cpp
+++ b/test/gjs-test-rooting.cpp
@@ -61,7 +61,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]