mirror of
https://github.com/SerenityOS/serenity
synced 2026-05-13 18:37:37 +02:00
Previously, if there was an unhandled exception in an async test, it might fail to call done() and timeout. Now we have a default "error" handler to catch unhandled exceptions and fail the test. A few tests want to actually test the behavior of window.onerror, so they need an escape hatch. (cherry picked from commit 8edaec79dea2f39a31ee97738dfa2e74911efe26)
20 lines
405 B
HTML
20 lines
405 B
HTML
<!DOCTYPE html>
|
|
<script src="../include.js"></script>
|
|
<script>
|
|
asyncTest(done => {
|
|
|
|
removeTestErrorHandler()
|
|
|
|
window.addEventListener("error", (event) => {
|
|
println(`onerror event fired: ${event.error}`);
|
|
done();
|
|
});
|
|
|
|
try {
|
|
throw new Error("FAIL");
|
|
} catch (e) {}
|
|
|
|
throw new Error("Uncaught error");
|
|
});
|
|
</script>
|