MCPcopy Create free account
hub / github.com/ember-cli/ember-cli / addHandler

Function addHandler

lib/utilities/will-interrupt-process.js:78–94  ·  view source on GitHub ↗

* Add process interruption handler * * When the first handler is added then automatically * sets up process interruption signals listeners * * @private * @method addHandler * @param {function} cb Callback to be called when process interruption fired

(cb)

Source from the content-addressed store, hash-verified

76 * @param {function} cb Callback to be called when process interruption fired
77 */
78 addHandler(cb) {
79 if (!_process) {
80 throw new Error('process is not captured');
81 }
82
83 let index = handlers.indexOf(cb);
84 if (index > -1) {
85 return;
86 }
87
88 if (handlers.length === 0) {
89 setupSignalsTrap();
90 }
91
92 handlers.push(cb);
93 captureExit.onExit(cb);
94 },
95
96 /**
97 * Remove process interruption handler

Callers

nothing calls this directly

Calls 1

setupSignalsTrapFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…