File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -190,7 +190,6 @@ pub const Window = struct {
190190 return page .loop .cancel (kv .value .loop_id );
191191 }
192192
193- // TODO handle callback arguments.
194193 pub fn _setTimeout (self : * Window , cbk : Function , delay : ? u32 , page : * Page ) ! u32 {
195194 return self .createTimeout (cbk , delay , page , .{});
196195 }
@@ -210,6 +209,10 @@ pub const Window = struct {
210209 return page .loop .cancel (kv .value .loop_id );
211210 }
212211
212+ pub fn _queueMicrotask (self : * Window , cbk : Function , page : * Page ) ! u32 {
213+ return self .createTimeout (cbk , 0 , page , .{});
214+ }
215+
213216 pub fn _matchMedia (_ : * const Window , media : []const u8 , page : * Page ) ! MediaQueryList {
214217 return .{
215218 .matches = false , // TODO?
@@ -468,4 +471,9 @@ test "Browser.HTML.Window" {
468471 .{ "scroll" , "true" },
469472 .{ "scrollend" , "true" },
470473 }, .{});
474+
475+ try runner .testCases (&.{
476+ .{ "var qm = false; window.queueMicrotask(() => {qm = true });" , null },
477+ .{ "qm" , "true" },
478+ }, .{});
471479}
You can’t perform that action at this time.
0 commit comments