summaryrefslogtreecommitdiff
path: root/src/node.cc
diff options
context:
space:
mode:
authorAnna Henningsen <anna@addaleax.net>2019-10-18 17:05:35 +0200
committerDaniel Bevenius <daniel.bevenius@gmail.com>2019-10-22 08:16:18 +0200
commit31217a8e88d7414579284267f8715112bf8a0fc6 (patch)
treed7add72e83fef8ea7779df087a8552c0ffc1748c /src/node.cc
parent71b342f93725a9bba5fa1f83a9f0fa88a482d759 (diff)
downloadandroid-node-v8-31217a8e88d7414579284267f8715112bf8a0fc6.tar.gz
android-node-v8-31217a8e88d7414579284267f8715112bf8a0fc6.tar.bz2
android-node-v8-31217a8e88d7414579284267f8715112bf8a0fc6.zip
cli: add --trace-uncaught flag
Add a flag that makes Node.js print the stack trace at the time of *throwing* uncaught exceptions, rather than at the creation of the `Error` object, if there is any. This is disabled by default because it affects GC behavior. PR-URL: https://github.com/nodejs/node/pull/30025 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Diffstat (limited to 'src/node.cc')
-rw-r--r--src/node.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/node.cc b/src/node.cc
index 935be9343f..f437ea4be9 100644
--- a/src/node.cc
+++ b/src/node.cc
@@ -265,6 +265,8 @@ int Environment::InitializeInspector(
void Environment::InitializeDiagnostics() {
isolate_->GetHeapProfiler()->AddBuildEmbedderGraphCallback(
Environment::BuildEmbedderGraph, this);
+ if (options_->trace_uncaught)
+ isolate_->SetCaptureStackTraceForUncaughtExceptions(true);
#if defined HAVE_DTRACE || defined HAVE_ETW
InitDTrace(this);