summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorcjihrig <cjihrig@gmail.com>2019-07-05 11:45:45 -0400
committercjihrig <cjihrig@gmail.com>2019-07-07 11:55:48 -0400
commit36fdf1aa6c87ccfaebabb8f9c8004baab0549b0b (patch)
tree6dd7e48af3347f61ed1494d6bf2fcfe8a041673f /src
parent7cf6f9e964aa00772965391c23acda6d71972a9a (diff)
downloadandroid-node-v8-36fdf1aa6c87ccfaebabb8f9c8004baab0549b0b.tar.gz
android-node-v8-36fdf1aa6c87ccfaebabb8f9c8004baab0549b0b.tar.bz2
android-node-v8-36fdf1aa6c87ccfaebabb8f9c8004baab0549b0b.zip
src: allow fatal exceptions to be enhanced
This commit allows fatal exceptions to be enhanced so that exceptions thrown from an unhandledException handler have the stack attached properly. PR-URL: https://github.com/nodejs/node/pull/28562 Fixes: https://github.com/nodejs/node/issues/28550 Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
Diffstat (limited to 'src')
-rw-r--r--src/node_errors.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/node_errors.cc b/src/node_errors.cc
index 298d84b4f3..0214521144 100644
--- a/src/node_errors.cc
+++ b/src/node_errors.cc
@@ -448,10 +448,11 @@ TryCatchScope::~TryCatchScope() {
HandleScope scope(env_->isolate());
Local<v8::Value> exception = Exception();
Local<v8::Message> message = Message();
+ EnhanceFatalException enhance = CanContinue() ?
+ EnhanceFatalException::kEnhance : EnhanceFatalException::kDontEnhance;
if (message.IsEmpty())
message = Exception::CreateMessage(env_->isolate(), exception);
- ReportFatalException(
- env_, exception, message, EnhanceFatalException::kDontEnhance);
+ ReportFatalException(env_, exception, message, enhance);
env_->Exit(7);
}
}