OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <title>Handling of evaluation errors, 2</title> |
| 3 |
| 4 <script src="/resources/testharness.js"></script> |
| 5 <script src="/resources/testharnessreport.js"></script> |
| 6 <script> |
| 7 setup({allow_uncaught_exception: true}); |
| 8 |
| 9 window.log = []; |
| 10 |
| 11 window.addEventListener("error", ev => log.push(ev.error)); |
| 12 |
| 13 const test_load = async_test( |
| 14 "Test that ill-founded cyclic dependencies cause ReferenceError " + |
| 15 "during evaluation, which leads to error events on window, and that " + |
| 16 "exceptions are remembered.\n"); |
| 17 window.addEventListener("load", test_load.step_func_done(ev => { |
| 18 const exn = log[1]; |
| 19 assert_array_equals(log, ["cycle-tdz-access-a", exn, exn, exn]); |
| 20 assert_equals(exn.constructor, ReferenceError); |
| 21 })); |
| 22 |
| 23 function unreachable() { log.push("unexpected"); } |
| 24 </script> |
| 25 <script type="module" src="cycle-tdz-access.js" async onerror="unreachable()"></
script> |
| 26 <script type="module" src="cycle-tdz-access.js" nomodule onerror="unreachable()"
></script> |
| 27 <script type="module" src="cycle-tdz-access.js" onerror="unreachable()"></script
> |
OLD | NEW |