Don't root a Realm that's used for one call.

This commit is contained in:
Josh Matthews 2023-05-29 00:47:31 -04:00
parent 0e8ac3fdac
commit ce023bea24

View file

@ -686,14 +686,14 @@ pub fn get_desired_proto(
// Fall back to getting the proto for our given proto id in the realm that
// GetFunctionRealm(newTarget) returns.
rooted!(in(*cx) let realm = GetFunctionRealm(*cx, new_target.handle().into()));
let realm = GetFunctionRealm(*cx, new_target.handle().into());
if (*realm).is_null() {
if realm.is_null() {
return Err(());
}
{
let _realm = JSAutoRealm::new(*cx, GetRealmGlobalOrNull(*realm));
let _realm = JSAutoRealm::new(*cx, GetRealmGlobalOrNull(realm));
rooted!(in(*cx) let global = CurrentGlobalOrNull(*cx));
get_per_interface_object_handle(
cx,