mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-14 07:02:54 +00:00
For example, running `alert(1)` will pause the event loop, during which time no JavaScript should execute. This patch extends this disruption to microtasks. This avoids a crash inside the microtask executor, which asserts the JS execution context stack is empty. This makes us behave the same as Firefox in the following page: <script> queueMicrotask(() => { console.log("inside microtask"); }); alert("hi"); </script> Before the aforementioned assertion was added, we would execute that microtask before showing the alert. Firefox does not do this, and now we don't either.
7 lines
157 B
HTML
7 lines
157 B
HTML
<script src="include.js"></script>
|
|
<script>
|
|
test(() => {
|
|
alert("Well hello friends!");
|
|
println("PASS (didn't crash)");
|
|
});
|
|
</script>
|