OLD | NEW |
(Empty) | |
| 1 |
| 2 <!DOCTYPE html> |
| 3 <html> |
| 4 <head> |
| 5 <title>html-script-module-evaluation-error-1</title> |
| 6 <script src="/resources/testharness.js"></script> |
| 7 <script src="/resources/testharnessreport.js"></script> |
| 8 </head> |
| 9 <body> |
| 10 <h1>html-script-module-evaluation-error-1</h1> |
| 11 <script> |
| 12 |
| 13 var log = []; |
| 14 setup({allow_uncaught_exception:true}); |
| 15 |
| 16 var test_load = async_test("test_load"); |
| 17 window.addEventListener("load", test_load.step_func_done(ev => { |
| 18 assert_array_equals(log, ["throw"]); |
| 19 })); |
| 20 |
| 21 // Note that there is only one error event. |
| 22 var test_error = async_test("test_error"); |
| 23 window.addEventListener("error", test_error.step_func_done(ev => { |
| 24 console.log(ev); |
| 25 assert_equals(ev.message, "Uncaught 666"); |
| 26 assert_array_equals(log, ["throw"]); |
| 27 |
| 28 })); |
| 29 |
| 30 function unreachable() { |
| 31 // Insert junk into |log| such that the above |assert_array_equals| |
| 32 // will fail. |
| 33 log.push("junk"); |
| 34 } |
| 35 |
| 36 </script> |
| 37 <script type="module" src="throw.js" onerror="unreachable()"></script> |
| 38 <script type="module" src="throw.js" onerror="unreachable()"></script> |
| 39 <script type="module" src="throw.js" async onerror="unreachable()"></script> |
| 40 <script type="module" src="throw.js" nomodule onerror="unreachable()"></scri
pt> |
| 41 </body> |
| 42 </html> |
OLD | NEW |