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
Next Next commit
Revert "fixup! fixup! repl: refactor to avoid unsafe array iteration"
This reverts commit 4d083aa.
  • Loading branch information
RaisinTen committed Jan 16, 2021
commit 7eca9ce43f3ba4c6d3218e17da6cd7fcbc983750
7 changes: 3 additions & 4 deletions lib/internal/util/inspect.js
Original file line number Diff line number Diff line change
Expand Up @@ -309,17 +309,16 @@ function inspect(value, opts) {
if (typeof opts === 'boolean') {
ctx.showHidden = opts;
} else if (opts) {
for (const key in opts) {
const optKeys = ObjectKeys(opts);
for (const key of optKeys) {
// TODO(BridgeAR): Find a solution what to do about stylize. Either make
// this function public or add a new API with a similar or better
// functionality.
if (
ObjectPrototypeHasOwnProperty(inspectDefaultOptions, key) ||
key === 'stylize') {
ctx[key] = opts[key];
} else if (
ObjectPrototypeHasOwnProperty(opts, key) &&
ctx.userOptions === undefined) {
} else if (ctx.userOptions === undefined) {
// This is required to pass through the actual user input.
ctx.userOptions = opts;
}
Expand Down