Skip to content

Commit 0008c09

Browse files
committed
do not harden in case that helps
1 parent 2475de3 commit 0008c09

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

lib/internal/url.js

+6-7
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ const {
3434
SymbolIterator,
3535
SymbolToStringTag,
3636
decodeURIComponent,
37-
hardenRegExp,
3837
} = primordials;
3938

4039
const { inspect } = require('internal/util/inspect');
@@ -117,7 +116,7 @@ const {
117116
revokeDataObject,
118117
} = internalBinding('blob');
119118

120-
const FORWARD_SLASH = hardenRegExp(/\//g);
119+
const FORWARD_SLASH = (/\//g;
121120

122121
const context = Symbol('context');
123122
const cannotBeBase = Symbol('cannot-be-base');
@@ -1505,11 +1504,11 @@ function fileURLToPath(path) {
15051504
// - CR: The carriage return character is also stripped out by the `pathname`
15061505
// setter.
15071506
// - TAB: The tab character is also stripped out by the `pathname` setter.
1508-
const percentRegEx = hardenRegExp(/%/g);
1509-
const backslashRegEx = hardenRegExp(/\\/g);
1510-
const newlineRegEx = hardenRegExp(/\n/g);
1511-
const carriageReturnRegEx = hardenRegExp(/\r/g);
1512-
const tabRegEx = hardenRegExp(/\t/g);
1507+
const percentRegEx = (/%/g;
1508+
const backslashRegEx = (/\\/g;
1509+
const newlineRegEx = (/\n/g;
1510+
const carriageReturnRegEx = (/\r/g;
1511+
const tabRegEx = (/\t/g;
15131512

15141513
function encodePathChars(filepath) {
15151514
if (StringPrototypeIncludes(filepath, '%'))

0 commit comments

Comments
 (0)