(outerProcess)
| 19 | |
| 20 | module.exports = { |
| 21 | capture(outerProcess) { |
| 22 | if (_process) { |
| 23 | throw new Error(`process already captured at: \n\n${_processCapturedLocation.stack}`); |
| 24 | } |
| 25 | |
| 26 | if (isEventEmitterCompatible(outerProcess) === false) { |
| 27 | throw new Error('attempt to capture bad process instance'); |
| 28 | } |
| 29 | |
| 30 | _process = outerProcess; |
| 31 | _processCapturedLocation = new Error(); |
| 32 | |
| 33 | // ember-cli and user apps have many dependencies, many of which require |
| 34 | // process.addListener('exit', ....) for cleanup, by default this limit for |
| 35 | // such listeners is 10, recently users have been increasing this and not to |
| 36 | // their fault, rather they are including large and more diverse sets of |
| 37 | // node_modules. |
| 38 | // |
| 39 | // https://github.com/babel/ember-cli-babel/issues/76 |
| 40 | _process.setMaxListeners(1000); |
| 41 | |
| 42 | // work around misbehaving libraries, so we can correctly cleanup before actually exiting. |
| 43 | captureExit.captureExit(); |
| 44 | }, |
| 45 | |
| 46 | /** |
| 47 | * Drops all the interruption handlers and disables an ability to add new one |
nothing calls this directly
no test coverage detected
searching dependent graphs…