From 5dee17bb3c7d7b6fcec0d3ac02e0348c558a206b Mon Sep 17 00:00:00 2001 From: Sam Roberts Date: Thu, 15 Aug 2019 12:05:43 -0700 Subject: [PATCH] src: rename --security-reverts to ...-revert It was called --security-revert prior to 12.x, but changed in https://github.com/nodejs/node/pull/22490. See: https://github.com/nodejs/nodejs.org/pull/2412#issuecomment-521739752 PR-URL: https://github.com/nodejs/node/pull/29153 Reviewed-By: Anna Henningsen Reviewed-By: Colin Ihrig Reviewed-By: Richard Lau Reviewed-By: Luigi Pinca Reviewed-By: Beth Griggs Reviewed-By: Rich Trott Reviewed-By: Trivikram Kamat Reviewed-By: James M Snell --- src/node_options.cc | 7 ++++++- test/parallel/test-security-revert-unknown.js | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/node_options.cc b/src/node_options.cc index eaa3e7d049b44b..80d6f99770cf08 100644 --- a/src/node_options.cc +++ b/src/node_options.cc @@ -640,7 +640,12 @@ PerProcessOptionsParser::PerProcessOptionsParser( &PerProcessOptions::debug_arraybuffer_allocations, kAllowedInEnvironment); - AddOption("--security-reverts", "", &PerProcessOptions::security_reverts); + + // 12.x renamed this inadvertently, so alias it for consistency within the + // release line, while using the original name for consistency with older + // release lines. + AddOption("--security-revert", "", &PerProcessOptions::security_reverts); + AddAlias("--security-reverts", "--security-revert"); AddOption("--completion-bash", "print source-able bash completion script", &PerProcessOptions::print_bash_completion); diff --git a/test/parallel/test-security-revert-unknown.js b/test/parallel/test-security-revert-unknown.js index 688076ce94582a..11f31ccd834406 100644 --- a/test/parallel/test-security-revert-unknown.js +++ b/test/parallel/test-security-revert-unknown.js @@ -5,7 +5,7 @@ const { spawnSync } = require('child_process'); const os = require('os'); const { signal, status, output } = - spawnSync(process.execPath, ['--security-reverts=not-a-cve']); + spawnSync(process.execPath, ['--security-revert=not-a-cve']); assert.strictEqual(signal, null); assert.strictEqual(status, 12); assert.strictEqual(