Remove global argument from Promise::new_in_current_realm.

This commit is contained in:
Josh Matthews 2023-02-16 23:22:01 -05:00
parent f79e1e327d
commit fca5833e21
30 changed files with 54 additions and 56 deletions

View file

@ -357,7 +357,7 @@ impl GPUDeviceMethods for GPUDevice {
/// https://gpuweb.github.io/gpuweb/#dom-gpudevice-lost
fn Lost(&self, comp: InRealm) -> Rc<Promise> {
let promise = Promise::new_in_current_realm(&self.global(), comp);
let promise = Promise::new_in_current_realm(comp);
*self.lost_promise.borrow_mut() = Some(promise.clone());
promise
}
@ -1117,7 +1117,7 @@ impl GPUDeviceMethods for GPUDevice {
/// https://gpuweb.github.io/gpuweb/#dom-gpudevice-poperrorscope
fn PopErrorScope(&self, comp: InRealm) -> Rc<Promise> {
let mut context = self.scope_context.borrow_mut();
let promise = Promise::new_in_current_realm(&self.global(), comp);
let promise = Promise::new_in_current_realm(comp);
let scope_id =
if let Some(meta) = context.scope_stack.iter().rev().find(|m| !m.popped.get()) {
meta.popped.set(true);