From 40a355a42d4a9444dc753c04c6608dade2f06a23 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 03:13:27 +0200 Subject: Adding upstream version 125.0.1. Signed-off-by: Daniel Baumann --- js/src/gc/MaybeRooted.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'js/src/gc/MaybeRooted.h') diff --git a/js/src/gc/MaybeRooted.h b/js/src/gc/MaybeRooted.h index fbeb0c553c..6b38172472 100644 --- a/js/src/gc/MaybeRooted.h +++ b/js/src/gc/MaybeRooted.h @@ -35,7 +35,7 @@ class MOZ_RAII FakeRooted : public RootedOperations> { explicit FakeRooted(JSContext* cx) : ptr(JS::SafelyInitialized::create()) {} - FakeRooted(JSContext* cx, T initial) : ptr(initial) {} + FakeRooted(JSContext* cx, const T& initial) : ptr(initial) {} FakeRooted(const FakeRooted&) = delete; @@ -44,6 +44,8 @@ class MOZ_RAII FakeRooted : public RootedOperations> { DECLARE_NONPOINTER_ACCESSOR_METHODS(ptr); DECLARE_NONPOINTER_MUTABLE_ACCESSOR_METHODS(ptr); + operator JS::Handle() { return JS::Handle::fromMarkedLocation(&ptr); } + private: T ptr; -- cgit v1.2.3