[gjs/mozjs102: 50/59] object: Add constructor argument




commit 83d19c224f8434e0e7f8ce8fe3b72f85a4a7621d
Author: Evan Welsh <contact evanwelsh com>
Date:   Fri Jul 22 12:15:58 2022 -0700

    object: Add constructor argument
    
    mozjs91 had a convenience constructor for Rooted that would also construct
    the template type if its constructor had a single JSContext* argument.
    This constructor will be removed in mozjs102, so we have to pass the
    JSContext twice here.

 gi/object.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/gi/object.cpp b/gi/object.cpp
index 6c9a62b06..1e56437f9 100644
--- a/gi/object.cpp
+++ b/gi/object.cpp
@@ -1192,7 +1192,7 @@ bool ObjectPrototype::props_to_g_parameters(JSContext* context,
     size_t ix, length;
     JS::RootedId prop_id(context);
     JS::RootedValue value(context);
-    JS::Rooted<JS::IdVector> ids(context);
+    JS::Rooted<JS::IdVector> ids(context, context);
     std::unordered_set<GParamSpec*> visited_params;
     if (!JS_Enumerate(context, props, &ids)) {
         gjs_throw(context, "Failed to create property iterator for object props hash");


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]