()
| 68 | }); |
| 69 | |
| 70 | function test4() { |
| 71 | // This test creates two nested domains: d5 and d6. d6 doesn't register an |
| 72 | // error handler. When the timer's callback is called, because async |
| 73 | // operations like timer callbacks are bound to the domain that was active |
| 74 | // at the time of their creation, and because both d5 and d6 domains have |
| 75 | // exited by the time the timer's callback is called, its callback runs with |
| 76 | // only d6 on the domains stack. Since d6 doesn't register an error handler, |
| 77 | // the process' uncaughtException event should be emitted. |
| 78 | const d5 = domain.create(); |
| 79 | const d6 = domain.create(); |
| 80 | |
| 81 | d5.on('error', function onErrorInD2Domain() { |
| 82 | process.send('errorHandledByDomain'); |
| 83 | }); |
| 84 | |
| 85 | d5.run(function() { |
| 86 | d6.run(function() { |
| 87 | setTimeout(function onTimeout() { |
| 88 | throw new Error('boom!'); |
| 89 | }, 1); |
| 90 | }); |
| 91 | }); |
| 92 | } |
| 93 | |
| 94 | tests.push({ |
| 95 | fn: test4, |
nothing calls this directly
no test coverage detected
searching dependent graphs…