From b7bf2a867f848eb2876d8b46bf15ef0b2edaf58c Mon Sep 17 00:00:00 2001 From: Jesse Wright <63333554+jeswr@users.noreply.github.com> Date: Tue, 14 Feb 2023 09:46:01 +1100 Subject: [PATCH 1/2] Update shell.js --- src/shell.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shell.js b/src/shell.js index 96653cfc90fea..03ce9eac6d085 100644 --- a/src/shell.js +++ b/src/shell.js @@ -255,7 +255,7 @@ if (ENVIRONMENT_IS_NODE) { // not be needed with node v15 and about because it is now the default // behaviour: // See https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode - var nodeMajor = process.version.match(/^v(\d+)\./)[1]; + var nodeMajor = Number(process.versions.node.split(".")[0]); if (nodeMajor < 15) { process['on']('unhandledRejection', function(reason) { throw reason; }); } From d2b011886a1178f0e5d53be8efb79ff9feaa995a Mon Sep 17 00:00:00 2001 From: Jesse Wright <63333554+jeswr@users.noreply.github.com> Date: Wed, 15 Feb 2023 23:34:38 +1100 Subject: [PATCH 2/2] chore: don't cast nodeMajor as number --- src/shell.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shell.js b/src/shell.js index 03ce9eac6d085..8a16b828f0a84 100644 --- a/src/shell.js +++ b/src/shell.js @@ -255,7 +255,7 @@ if (ENVIRONMENT_IS_NODE) { // not be needed with node v15 and about because it is now the default // behaviour: // See https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode - var nodeMajor = Number(process.versions.node.split(".")[0]); + var nodeMajor = process.versions.node.split(".")[0]; if (nodeMajor < 15) { process['on']('unhandledRejection', function(reason) { throw reason; }); }