src: fix domains + --abort-on-uncaught-exception
authorChris Dickinson <christopher.s.dickinson@gmail.com>
Sun, 22 Feb 2015 22:54:25 +0000 (14:54 -0800)
committerChris Dickinson <christopher.s.dickinson@gmail.com>
Wed, 25 Feb 2015 22:01:29 +0000 (14:01 -0800)
commit0af4c9ea7434e4f505dbe071357e4bc3b4ab2a8a
tree1cf138f18ca90b5262abe9c2c9f3b16482740011
parent2ca22aacbdd11c572e71ee1b15af3bec1e04a0c1
src: fix domains + --abort-on-uncaught-exception

If run with --abort-on-uncaught-exception, V8 will abort the process
whenever it does not see a JS-installed CatchClause in the stack. C++
TryCatch clauses are ignored. Domains work by setting a FatalException
handler which is ignored when running in abort mode.

This patch modifies MakeCallback to call its target function through a
JS function that installs a CatchClause and manually calls _fatalException
on error, if the process is both using domains and is in abort mode.

Semver: patch
PR-URL: https://github.com/iojs/io.js/pull/922
Fixes: https://github.com/iojs/io.js/issues/836
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
src/async-wrap.cc
src/env-inl.h
src/env.h
src/node.cc
src/node.js
test/parallel/test-domain-abort-on-uncaught.js [new file with mode: 0644]