OLD | NEW |
---|---|
1 <!-- | 1 <!DOCTYPE html> |
2 This test case caught a crash bug in Chrome, due to a logic bug in the spec when | 2 <title>html-script-module-instantiation-error-1</title> |
3 a second <script> element tried to load a previously-failed module. As such, the | |
4 test passes as long as nothing crashes. | |
5 | 3 |
6 See https://github.com/whatwg/html/pull/2559 for background. | 4 <script src="/resources/testharness.js"></script> |
7 --> | 5 <script src="/resources/testharnessreport.js"></script> |
6 <script> | |
7 setup({allow_uncaught_exception: true}); | |
8 | 8 |
9 <!DOCTYPE html> | 9 var log = []; |
10 <html> | 10 |
11 <head> | 11 window.addEventListener("error", ev => log.push(ev.error)); |
12 <title>html-script-module-instantiation-error-1</title> | 12 |
13 <script src="/resources/testharness.js"></script> | 13 var test_load = async_test("test_load"); |
14 <script src="/resources/testharnessreport.js"></script> | 14 window.addEventListener("load", test_load.step_func_done(ev => { |
15 </head> | 15 const exn = log[0]; |
16 <body> | 16 assert_array_equals(log, [exn, 1, exn, 2, exn, 3, exn, 4, exn, 5]); |
domenic
2017/05/03 23:49:30
This is a great test, with the interleaving and or
| |
17 <h1>html-script-module-instantiation-error-1</h1> | 17 assert_equals(exn.constructor, SyntaxError); |
18 <script> setup({allow_uncaught_exception: true}) </script> | 18 })); |
19 <script type="module" src="./instantiation-error-1.js"></script> | 19 |
20 <script type="module" src="./instantiation-error-1.js"></script> | 20 function unreachable() { |
21 </body> | 21 log.push("unexpected"); |
22 </html> | 22 } |
23 </script> | |
24 <script type="module" src="./missing-export.js" | |
25 onerror="unreachable()" onload="log.push(1)"></script> | |
26 <script type="module" src="./missing-export.js" | |
27 onerror="unreachable()" onload="log.push(2)"></script> | |
28 <script type="module" src="./missing-export-nested.js" | |
29 onerror="unreachable()" onload="log.push(3)"></script> | |
30 <script type="module" src="./missing-export.js" | |
31 onerror="unreachable()" onload="log.push(4)"></script> | |
32 <script type="module" src="./missing-export-nested.js" | |
33 onerror="unreachable()" onload="log.push(5)"></script> | |
OLD | NEW |