mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
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:
@@ -173,7 +173,7 @@ function formatTime(ms) {
|
||||
}
|
||||
|
||||
function safeTraceLabel(label) {
|
||||
return label.replace(/\\/g, '\\\\').replaceAll('"', '\\"');
|
||||
return label.replaceAll('\\', '\\\\').replaceAll('"', '\\"');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user