summaryrefslogtreecommitdiff
path: root/lib/domain.js
diff options
context:
space:
mode:
authorisaacs <i@izs.me>2012-12-26 12:28:33 -0800
committerisaacs <i@izs.me>2012-12-29 10:37:30 -0800
commit4401bb47bfa4fe72c2755c428577903ece5cfaa0 (patch)
tree84a4f31447498d9e165fd998b7e7547ab5f60846 /lib/domain.js
parentc6e958d44d6674676581ced360530f85508121a2 (diff)
downloadandroid-node-v8-4401bb47bfa4fe72c2755c428577903ece5cfaa0.tar.gz
android-node-v8-4401bb47bfa4fe72c2755c428577903ece5cfaa0.tar.bz2
android-node-v8-4401bb47bfa4fe72c2755c428577903ece5cfaa0.zip
domain: Do not use uncaughtException handler
This adds a process._fatalException method which is called into from C++ in order to either emit the 'uncaughtException' method, or emit 'error' on the active domain. The 'uncaughtException' event is an implementation detail that it would be nice to deprecate one day, so exposing it as part of the domain machinery is not ideal. Fix #4375
Diffstat (limited to 'lib/domain.js')
-rw-r--r--lib/domain.js21
1 files changed, 0 insertions, 21 deletions
diff --git a/lib/domain.js b/lib/domain.js
index 4fefb913c8..32259d7a73 100644
--- a/lib/domain.js
+++ b/lib/domain.js
@@ -46,27 +46,6 @@ exports._stack = stack;
exports.active = null;
-// loading this file the first time sets up the global
-// uncaughtException handler.
-process.on('uncaughtException', uncaughtHandler);
-
-function uncaughtHandler(er) {
- // if there's an active domain, then handle this there.
- // Note that if this error emission throws, then it'll just crash.
- if (exports.active && !exports.active._disposed) {
- util._extend(er, {
- domain: exports.active,
- domain_thrown: true
- });
- exports.active.emit('error', er);
- if (exports.active) exports.active.exit();
- } else if (process.listeners('uncaughtException').length === 1) {
- // if there are other handlers, then they'll take care of it.
- // but if not, then we need to crash now.
- throw er;
- }
-}
-
inherits(Domain, EventEmitter);
function Domain() {