| 101 | } |
| 102 | |
| 103 | async function testNoCrashConsoleLogBeforeThrow() { |
| 104 | const session = new inspector.Session(); |
| 105 | session.connect(); |
| 106 | let attempt = 1; |
| 107 | process.on('warning', common.mustCall(3)); |
| 108 | session.on('inspectorNotification', () => { |
| 109 | if (attempt++ > 3) |
| 110 | return; |
| 111 | console.log('console.log in handler'); |
| 112 | throw new Error('Exception in handler'); |
| 113 | }); |
| 114 | session.post('Runtime.enable'); |
| 115 | console.log('Did not crash'); |
| 116 | session.disconnect(); |
| 117 | } |
| 118 | |
| 119 | async function doTests() { |
| 120 | await testNoCrashWithExceptionInCallback(); |