Skip to content

Commit 8491c70

Browse files
committed
url: fix permanent deoptimizations
PR-URL: #12456 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent a641b7c commit 8491c70

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

lib/internal/url.js

+9-9
Original file line numberDiff line numberDiff line change
@@ -232,9 +232,9 @@ class URL {
232232
if (typeof depth === 'number' && depth < 0)
233233
return opts.stylize('[Object]', 'special');
234234

235-
const ctor = getConstructorOf(this);
235+
var ctor = getConstructorOf(this);
236236

237-
const obj = Object.create({
237+
var obj = Object.create({
238238
constructor: ctor === null ? URL : ctor
239239
});
240240

@@ -879,20 +879,20 @@ class URLSearchParams {
879879
if (typeof recurseTimes === 'number' && recurseTimes < 0)
880880
return ctx.stylize('[Object]', 'special');
881881

882-
const separator = ', ';
883-
const innerOpts = Object.assign({}, ctx);
882+
var separator = ', ';
883+
var innerOpts = Object.assign({}, ctx);
884884
if (recurseTimes !== null) {
885885
innerOpts.depth = recurseTimes - 1;
886886
}
887-
const innerInspect = (v) => util.inspect(v, innerOpts);
887+
var innerInspect = (v) => util.inspect(v, innerOpts);
888888

889-
const list = this[searchParams];
890-
const output = [];
889+
var list = this[searchParams];
890+
var output = [];
891891
for (var i = 0; i < list.length; i += 2)
892892
output.push(`${innerInspect(list[i])} => ${innerInspect(list[i + 1])}`);
893893

894-
const colorRe = /\u001b\[\d\d?m/g;
895-
const length = output.reduce(
894+
var colorRe = /\u001b\[\d\d?m/g;
895+
var length = output.reduce(
896896
(prev, cur) => prev + cur.replace(colorRe, '').length + separator.length,
897897
-separator.length
898898
);

0 commit comments

Comments
 (0)