alexscheelmeyer/node-phantom — pull request #36 by MrOrz (2013-02-20 11:57:25+00:00)
Title: Handling PhantomJS crash.

I have encountered several PhantomJS crashes.

The crash causes aborted children processes and the the corresponding http server is never closed. This blocks the script from exiting normally.

In commit `#2038394` The phantom process's exit event is handled. Though there exists another process exit event handler (in `module.exports.create`), but it was meant for detecting spawning failure. Therefore I added my exit event handler in the callback of the `spawnPhantom` method.

In commit `#f6fec47` I expose the child process's `on` method to the phantom proxy, enabling the developers to handle the the child process events.