Skip to content
Closed
Changes from 1 commit
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
Prev Previous commit
Revert "fixup! fixup! repl: refactor to avoid unsafe array iteration"
This reverts commit 4fab6a8.
  • Loading branch information
RaisinTen committed Jan 17, 2021
commit d94f46c94c3f2a263a10c9d0239f95a1bb7c7372
8 changes: 3 additions & 5 deletions lib/internal/util/inspect.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ const {
RegExp,
RegExpPrototypeTest,
RegExpPrototypeToString,
SafeArrayIterator,
SafeStringIterator,
SafeMap,
SafeSet,
Expand Down Expand Up @@ -1871,19 +1870,18 @@ function tryStringify(arg) {
}

function format(...args) {
return formatWithOptionsInternal(undefined, ...new SafeArrayIterator(args));
return formatWithOptionsInternal(undefined, args);
Comment thread
aduh95 marked this conversation as resolved.
Resolved
}

function formatWithOptions(inspectOptions, ...args) {
if (typeof inspectOptions !== 'object' || inspectOptions === null) {
throw new ERR_INVALID_ARG_TYPE(
'inspectOptions', 'object', inspectOptions);
}
return formatWithOptionsInternal(inspectOptions,
...new SafeArrayIterator(args));
return formatWithOptionsInternal(inspectOptions, args);
}

function formatWithOptionsInternal(inspectOptions, ...args) {
function formatWithOptionsInternal(inspectOptions, args) {
const first = args[0];
let a = 0;
let str = '';
Expand Down