lib,test: remove unneeded escaping of / · nodejs/node@f3861c2 · GitHub
Skip to content

Commit f3861c2

Browse files
Trottaddaleax
authored andcommitted
lib,test: remove unneeded escaping of /
The `/` character does not need to be escaped when occurring inside a character class in a regular expression. Remove such instances of escaping in the code base. PR-URL: #9485 Reviewed-By: Prince John Wesley <princejohnwesley@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Teddy Katz <teddy.katz@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io>
1 parent c350268 commit f3861c2

4 files changed

Lines changed: 9 additions & 9 deletions

File tree

lib/fs.js

Lines changed: 4 additions & 4 deletions

lib/url.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ Url.prototype.parse = function(url, parseQueryString, slashesDenoteHost) {
200200
// user@server is *always* interpreted as a hostname, and url
201201
// resolution will treat //foo/bar as host=foo,path=bar because that's
202202
// how the browser resolves relative URLs.
203-
if (slashesDenoteHost || proto || /^\/\/[^@\/]+@[^@\/]+/.test(rest)) {
203+
if (slashesDenoteHost || proto || /^\/\/[^@/]+@[^@/]+/.test(rest)) {
204204
var slashes = rest.charCodeAt(0) === 47/*/*/ &&
205205
rest.charCodeAt(1) === 47/*/*/;
206206
if (slashes && !(proto && hostlessProtocol[proto])) {

test/debugger/test-debugger-repl-break-in-module.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ repl.addTest('sb(")^$*+?}{|][(.js\\\\", 1)', [
2020

2121
// continue - the breakpoint should be triggered
2222
repl.addTest('c', [
23-
/break in .*[\\\/]mod\.js:2/,
23+
/break in .*[\\/]mod\.js:2/,
2424
/1/, /2/, /3/, /4/
2525
]);
2626

@@ -42,7 +42,7 @@ repl.addTest('restart', [].concat(
4242

4343
// continue - the breakpoint should be triggered
4444
repl.addTest('c', [
45-
/break in .*[\\\/]mod\.js:2/,
45+
/break in .*[\\/]mod\.js:2/,
4646
/1/, /2/, /3/, /4/
4747
]);
4848

@@ -53,7 +53,7 @@ repl.addTest('cb("mod.js", 2)', [
5353
]);
5454

5555
repl.addTest('c', [
56-
/break in .*[\\\/]main\.js:4/,
56+
/break in .*[\\/]main\.js:4/,
5757
/2/, /3/, /4/, /5/, /6/
5858
]);
5959

test/parallel/test-require-json.js

Lines changed: 1 addition & 1 deletion

0 commit comments

Comments
 (0)