Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lib,test: remove unneeded escaping of / #9485

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions lib/fs.js
Original file line number Diff line number Diff line change
Expand Up @@ -1436,13 +1436,13 @@ fs.unwatchFile = function(filename, listener) {
// Regexp that finds the next portion of a (partial) path
// result is [base_with_slash, base], e.g. ['somedir/', 'somedir']
const nextPartRe = isWindows ?
/(.*?)(?:[\/\\]+|$)/g :
/(.*?)(?:[\/]+|$)/g;
/(.*?)(?:[/\\]+|$)/g :
/(.*?)(?:[/]+|$)/g;

// Regex to find the device root, including trailing slash. E.g. 'c:\\'.
const splitRootRe = isWindows ?
/^(?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/][^\\\/]+)?[\\\/]*/ :
/^[\/]*/;
/^(?:[a-zA-Z]:|[\\/]{2}[^\\/]+[\\/][^\\/]+)?[\\/]*/ :
/^[/]*/;

function encodeRealpathResult(result, options, err) {
if (!options || !options.encoding || options.encoding === 'utf8' || err)
Expand Down
2 changes: 1 addition & 1 deletion lib/url.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ Url.prototype.parse = function(url, parseQueryString, slashesDenoteHost) {
// user@server is *always* interpreted as a hostname, and url
// resolution will treat //foo/bar as host=foo,path=bar because that's
// how the browser resolves relative URLs.
if (slashesDenoteHost || proto || /^\/\/[^@\/]+@[^@\/]+/.test(rest)) {
if (slashesDenoteHost || proto || /^\/\/[^@/]+@[^@/]+/.test(rest)) {
var slashes = rest.charCodeAt(0) === 47/*/*/ &&
rest.charCodeAt(1) === 47/*/*/;
if (slashes && !(proto && hostlessProtocol[proto])) {
Expand Down
6 changes: 3 additions & 3 deletions test/debugger/test-debugger-repl-break-in-module.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ repl.addTest('sb(")^$*+?}{|][(.js\\\\", 1)', [

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

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

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

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

repl.addTest('c', [
/break in .*[\\\/]main\.js:4/,
/break in .*[\\/]main\.js:4/,
/2/, /3/, /4/, /5/, /6/
]);

Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-require-json.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ var assert = require('assert');
try {
require(path.join(common.fixturesDir, 'invalid.json'));
} catch (err) {
var re = /test[\/\\]fixtures[\/\\]invalid.json: Unexpected string/;
var re = /test[/\\]fixtures[/\\]invalid.json: Unexpected string/;
var i = err.message.match(re);
assert.notStrictEqual(null, i, 'require() json error should include path');
}