mirror of
https://github.com/nodejs/node.git
synced 2025-08-15 13:48:44 +02:00
lib: refactor to avoid unsafe regex primordials
PR-URL: https://github.com/nodejs/node/pull/43475 Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com> Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
This commit is contained in:
parent
411fb21723
commit
a055337a02
39 changed files with 206 additions and 208 deletions
|
@ -36,7 +36,7 @@ const {
|
|||
ObjectAssign,
|
||||
ObjectDefineProperty,
|
||||
ObjectPrototypeHasOwnProperty,
|
||||
RegExpPrototypeTest,
|
||||
RegExpPrototypeExec,
|
||||
SafeSet,
|
||||
StringPrototypeSlice,
|
||||
StringPrototypeToUpperCase,
|
||||
|
@ -571,7 +571,7 @@ function normalizeSpawnArguments(file, args, options) {
|
|||
else
|
||||
file = process.env.comspec || 'cmd.exe';
|
||||
// '/d /s /c' is used only for cmd.exe.
|
||||
if (RegExpPrototypeTest(/^(?:.*\\)?cmd(?:\.exe)?$/i, file)) {
|
||||
if (RegExpPrototypeExec(/^(?:.*\\)?cmd(?:\.exe)?$/i, file) !== null) {
|
||||
args = ['/d', '/s', '/c', `"${command}"`];
|
||||
windowsVerbatimArguments = true;
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue