lib: remove redundant global regexps · nodejs/node@f10239f

2 files changed

lines changed

Original file line numberDiff line numberDiff line change

@@ -173,7 +173,7 @@ function formatTime(ms) {

173173

}

174174
175175

function safeTraceLabel(label) {

176-

return label.replace(/\\/g, '\\\\').replaceAll('"', '\\"');

176+

return label.replaceAll('\\', '\\\\').replaceAll('"', '\\"');

177177

}

178178
179179

/**

Original file line numberDiff line numberDiff line change

@@ -705,7 +705,7 @@ Url.prototype.format = function format() {

705705

}

706706

}

707707
708-

search = search.replace(/#/g, '%23');

708+

search = search.replaceAll('#', '%23');

709709
710710

if (hash && hash.charCodeAt(0) !== CHAR_HASH)

711711

hash = '#' + hash;