queueMicrotask added

This commit is contained in:
Patrick Shaughnessy 2020-01-13 13:15:48 -05:00
parent 968b45f9dc
commit b01b2d3d2e
11 changed files with 42 additions and 75 deletions

View file

@ -5,6 +5,7 @@
use crate::compartments::InCompartment;
use crate::dom::bindings::cell::{DomRefCell, Ref};
use crate::dom::bindings::codegen::Bindings::RequestBinding::RequestInit;
use crate::dom::bindings::codegen::Bindings::VoidFunctionBinding::VoidFunction;
use crate::dom::bindings::codegen::Bindings::WorkerBinding::WorkerType;
use crate::dom::bindings::codegen::Bindings::WorkerGlobalScopeBinding::WorkerGlobalScopeMethods;
use crate::dom::bindings::codegen::UnionTypes::{RequestOrUSVString, StringOrFunction};
@ -341,6 +342,12 @@ impl WorkerGlobalScopeMethods for WorkerGlobalScope {
self.ClearTimeout(handle);
}
// https://html.spec.whatwg.org/multipage/#dom-queuemicrotask
fn QueueMicrotask(&self, callback: Rc<VoidFunction>) {
self.upcast::<GlobalScope>()
.queue_function_as_microtask(callback);
}
#[allow(unrooted_must_root)]
// https://fetch.spec.whatwg.org/#fetch-method
fn Fetch(