mirror of https://github.com/nodejs/node.git
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
parent
bd3c25cf31
commit
eef06f72eb
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue