Use explicit reborrows with mozjs::MutableHandle (#35892)

* Explicitly reborrow MutableHandles

Signed-off-by: Greg Morenz <greg-morenz@droid.cafe>

* Unify jsapi_wrappers

Signed-off-by: Greg Morenz <greg-morenz@droid.cafe>

* Format mozjs changes

Signed-off-by: Greg Morenz <greg-morenz@droid.cafe>

* Update mozjs version

Signed-off-by: Greg Morenz <greg-morenz@droid.cafe>

---------

Signed-off-by: Greg Morenz <greg-morenz@droid.cafe>
This commit is contained in:
Greg Morenz 2025-03-22 21:23:52 -04:00 committed by GitHub
parent 40270cb626
commit 4ecf0909e5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 67 additions and 44 deletions

View file

@ -241,7 +241,7 @@ pub(crate) fn create_interface_prototype_object(
regular_properties: &[Guard<&'static [JSPropertySpec]>],
constants: &[Guard<&[ConstantSpec]>],
unscopable_names: &[&CStr],
rval: MutableHandleObject,
mut rval: MutableHandleObject,
) {
create_object(
cx,
@ -251,7 +251,7 @@ pub(crate) fn create_interface_prototype_object(
regular_methods,
regular_properties,
constants,
rval,
rval.reborrow(),
);
if !unscopable_names.is_empty() {
@ -289,7 +289,7 @@ pub(crate) fn create_noncallback_interface_object(
name: &CStr,
length: u32,
legacy_window_alias_names: &[&CStr],
rval: MutableHandleObject,
mut rval: MutableHandleObject,
) {
create_object(
cx,
@ -299,7 +299,7 @@ pub(crate) fn create_noncallback_interface_object(
static_methods,
static_properties,
constants,
rval,
rval.reborrow(),
);
unsafe {
assert!(JS_LinkConstructorAndPrototype(
@ -694,7 +694,7 @@ pub(crate) fn get_desired_proto(
global.handle(),
ProtoOrIfaceIndex::ID(proto_id),
creator,
desired_proto,
desired_proto.reborrow(),
);
if desired_proto.is_null() {
return Err(());