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>
This commit is contained in:
Gürgün Dayıoğlu authored and Antoine du Hamel committed 2024-12-10 20:30:59 +01:00
1 parent fa667d609e
commit f10239fde7
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -173,7 +173,7 @@ function formatTime(ms) {
}
function safeTraceLabel(label) {
return label.replace(/\\/g, '\\\\').replaceAll('"', '\\"');
return label.replaceAll('\\', '\\\\').replaceAll('"', '\\"');
}
/**
+1 -1
View File
@@ -705,7 +705,7 @@ Url.prototype.format = function format() {
}
}
search = search.replace(/#/g, '%23');
search = search.replaceAll('#', '%23');
if (hash && hash.charCodeAt(0) !== CHAR_HASH)
hash = '#' + hash;