From a76c2ae70184dde0ec3f78a2379a90d9ce24a20d Mon Sep 17 00:00:00 2001 From: Sam Roberts Date: Mon, 26 Jun 2017 11:24:33 -0700 Subject: [PATCH] src: --abort-on-uncaught-exception in NODE_OPTIONS Allow --abort-on-uncaught-exception in NODE_OPTIONS, its useful to enable for post-mortem debugging. Backport-PR-URL: https://github.com/nodejs/node/pull/12677 PR-URL: https://github.com/nodejs/node/pull/13932 Reviewed-By: Colin Ihrig Reviewed-By: James M Snell --- doc/api/cli.md | 1 + src/node.cc | 1 + test/parallel/test-cli-node-options.js | 5 +++-- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/doc/api/cli.md b/doc/api/cli.md index a9941ea5d9a80a..56c4ea941ca65b 100644 --- a/doc/api/cli.md +++ b/doc/api/cli.md @@ -367,6 +367,7 @@ Node options that are allowed are: - `--zero-fill-buffers` V8 options that are allowed are: +- `--abort-on-uncaught-exception` - `--max_old_space_size` diff --git a/src/node.cc b/src/node.cc index dd49482dd442a2..882c72a67eb330 100644 --- a/src/node.cc +++ b/src/node.cc @@ -3811,6 +3811,7 @@ static void CheckIfAllowedInEnv(const char* exe, bool is_env, "--icu-data-dir", // V8 options + "--abort-on-uncaught-exception", "--max_old_space_size", }; diff --git a/test/parallel/test-cli-node-options.js b/test/parallel/test-cli-node-options.js index eb53fa8f3db285..104473bfa69e34 100644 --- a/test/parallel/test-cli-node-options.js +++ b/test/parallel/test-cli-node-options.js @@ -41,7 +41,8 @@ function disallow(opt) { const printA = require.resolve('../fixtures/printA.js'); -expect('-r ' + printA, 'A\nB\n'); +expect(`-r ${printA}`, 'A\nB\n'); +expect('--abort-on-uncaught-exception', 'B\n'); expect('--no-deprecation', 'B\n'); expect('--no-warnings', 'B\n'); expect('--trace-warnings', 'B\n'); @@ -58,7 +59,7 @@ if (common.hasCrypto) { } expect('--icu-data-dir=_d', 'B\n'); - // V8 options +// V8 options expect('--max_old_space_size=0', 'B\n'); function expect(opt, want) {