lib: use `internal/options` to query `--abort-on-uncaught-exception` · nodejs/node@b06f2fa · GitHub
Skip to content

Commit b06f2fa

Browse files
joyeecheungaddaleax
authored andcommitted
lib: use internal/options to query --abort-on-uncaught-exception
Instead of using `internalBinding('config').shouldAbortOnUncaughtException`. Also removes that property from the binding. PR-URL: #25862 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
1 parent ef9139e commit b06f2fa

4 files changed

Lines changed: 17 additions & 6 deletions

File tree

lib/internal/async_hooks.js

Lines changed: 6 additions & 1 deletion

lib/internal/policy/manifest.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ const { entries } = Object;
2020
const kIntegrities = new SafeWeakMap();
2121
const kReactions = new SafeWeakMap();
2222
const kRelativeURLStringPattern = /^\.{0,2}\//;
23-
const { shouldAbortOnUncaughtException } = internalBinding('config');
23+
const { getOptionValue } = require('internal/options');
24+
const shouldAbortOnUncaughtException =
25+
getOptionValue('--abort-on-uncaught-exception');
2426
const { abort, exit, _rawDebug } = process;
2527

2628
function REACTION_THROW(error) {

src/node_config.cc

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,6 @@ static void Initialize(Local<Object> target,
9595
if (env->options()->expose_internals)
9696
READONLY_TRUE_PROPERTY(target, "exposeInternals");
9797

98-
if (env->abort_on_uncaught_exception())
99-
READONLY_TRUE_PROPERTY(target, "shouldAbortOnUncaughtException");
100-
10198
READONLY_PROPERTY(target,
10299
"bits",
103100
Number::New(env->isolate(), 8 * sizeof(intptr_t)));

src/node_options.cc

Lines changed: 8 additions & 1 deletion

0 commit comments

Comments
 (0)