fixes dereferencing on an immutable reference (#31864)

This commit is contained in:
Aarya Khandelwal 2024-03-26 14:07:44 +05:30 committed by GitHub
parent 585e0d69cd
commit f7669b5238
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
32 changed files with 76 additions and 77 deletions

View file

@ -88,7 +88,7 @@ impl Drop for Promise {
impl Promise {
pub fn new(global: &GlobalScope) -> Rc<Promise> {
let realm = enter_realm(&*global);
let realm = enter_realm(global);
let comp = InRealm::Entered(&realm);
Promise::new_in_current_realm(comp)
}
@ -175,7 +175,7 @@ impl Promise {
T: ToJSValConvertible,
{
let cx = GlobalScope::get_cx();
let _ac = enter_realm(&*self);
let _ac = enter_realm(self);
rooted!(in(*cx) let mut v = UndefinedValue());
unsafe {
val.to_jsval(*cx, v.handle_mut());
@ -198,7 +198,7 @@ impl Promise {
T: ToJSValConvertible,
{
let cx = GlobalScope::get_cx();
let _ac = enter_realm(&*self);
let _ac = enter_realm(self);
rooted!(in(*cx) let mut v = UndefinedValue());
unsafe {
val.to_jsval(*cx, v.handle_mut());
@ -209,7 +209,7 @@ impl Promise {
#[allow(unsafe_code)]
pub fn reject_error(&self, error: Error) {
let cx = GlobalScope::get_cx();
let _ac = enter_realm(&*self);
let _ac = enter_realm(self);
rooted!(in(*cx) let mut v = UndefinedValue());
unsafe {
error.to_jsval(*cx, &self.global(), v.handle_mut());