Files
serenity/Tests/LibWeb/Text/input/HTML/Window-onerror.html
Tim Ledbetter fa08ac3631 LibWeb: Fire error event when script has an execution error
We now use the "report an exception" AO when a script has an execution
error. This has mostly replaced the older "report the exception" AO in
various specifications. Using this newer AO ensures that
`window.onerror` is invoked when a script has an execution error.

(cherry picked from commit 579a289d3db849657987c3310e7b1d71d290b566)
2024-11-10 10:46:01 -05:00

17 lines
370 B
HTML

<!DOCTYPE html>
<script src="../include.js"></script>
<script>
asyncTest(done => {
window.addEventListener("error", (event) => {
println(`onerror event fired: ${event.error}`);
done();
});
try {
throw new Error("FAIL");
} catch (e) {}
throw new Error("Uncaught error");
});
</script>