MCPcopy Index your code
hub / github.com/nodejs/node / sigintHandlersWrap

Function sigintHandlersWrap

lib/vm.js:275–289  ·  view source on GitHub ↗
(fn, thisArg, argsArray)

Source from the content-addressed store, hash-verified

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.
275function 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
291function runInContext(code, contextifiedObject, options) {
292 validateContext(contextifiedObject);

Callers 2

runInThisContextMethod · 0.85
runInContextMethod · 0.85

Calls 2

removeAllListenersMethod · 0.45
addListenerMethod · 0.45

Tested by

no test coverage detected