lib: remove redundant global regexps

PR-URL: https://github.com/nodejs/node/pull/56182
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: LiviaMedeiros <livia@cirno.name>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
pull/56215/head
Gürgün Dayıoğlu 2024-12-10 13:18:18 +01:00 committed by GitHub
parent bd3c25cf31
commit eef06f72eb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View File

@ -173,7 +173,7 @@ function formatTime(ms) {
}
function safeTraceLabel(label) {
return label.replace(/\\/g, '\\\\').replaceAll('"', '\\"');
return label.replaceAll('\\', '\\\\').replaceAll('"', '\\"');
}
/**

View File

@ -704,7 +704,7 @@ Url.prototype.format = function format() {
}
}
search = search.replace(/#/g, '%23');
search = search.replaceAll('#', '%23');
if (hash && hash.charCodeAt(0) !== CHAR_HASH)
hash = '#' + hash;