(fn, thisArg, argsArray)
| 273 | // Remove all SIGINT listeners and re-attach them after the wrapped function |
| 274 | // has executed, so that caught SIGINT are handled by the listeners again. |
| 275 | function sigintHandlersWrap(fn, thisArg, argsArray) { |
| 276 | const sigintListeners = process.rawListeners('SIGINT'); |
| 277 | |
| 278 | process.removeAllListeners('SIGINT'); |
| 279 | |
| 280 | try { |
| 281 | return ReflectApply(fn, thisArg, argsArray); |
| 282 | } finally { |
| 283 | // Add using the public methods so that the `newListener` handler of |
| 284 | // process can re-attach the listeners. |
| 285 | ArrayPrototypeForEach(sigintListeners, (listener) => { |
| 286 | process.addListener('SIGINT', listener); |
| 287 | }); |
| 288 | } |
| 289 | } |
| 290 | |
| 291 | function runInContext(code, contextifiedObject, options) { |
| 292 | validateContext(contextifiedObject); |
no test coverage detected