OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <meta charset="utf-8"> |
| 3 <script src="../../resources/testharness.js"></script> |
| 4 <script src="../../resources/testharnessreport.js"></script> |
| 5 <script> |
| 6 'use strict'; |
| 7 setup({ |
| 8 allow_uncaught_exception: true |
| 9 }); |
| 10 async_test(function(t) { |
| 11 var e = new Error('e'); |
| 12 var e2 = new Error('e2'); |
| 13 window.onerror = function (msg, url, line, col, error) { |
| 14 t.step(function() { |
| 15 assert_equals(msg, 'Uncaught Error: e2'); |
| 16 assert_equals(error, e2); |
| 17 }); |
| 18 t.done(); |
| 19 }; |
| 20 window.onrejectionhandled = function() { |
| 21 throw e2; |
| 22 }; |
| 23 var p = Promise.reject(e); |
| 24 setTimeout(function() { |
| 25 try { |
| 26 p.catch(function() {}); |
| 27 } catch (e) { |
| 28 assert_unreached('attaching a handler should not throw an error'); |
| 29 } |
| 30 }, 1); |
| 31 }, 'Throwing inside an unhandledrejection handler invokes the error handler.'); |
| 32 </script> |
OLD | NEW |