mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
fixes dereferencing on an immutable reference (#31864)
This commit is contained in:
parent
585e0d69cd
commit
f7669b5238
32 changed files with 76 additions and 77 deletions
|
@ -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());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue