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
fixup! fixup! repl: refactor to avoid unsafe array iteration
  • Loading branch information
RaisinTen committed Jan 15, 2021
commit 4d083aaaf199338e420af5ddeb402f814a9e544e
7 changes: 4 additions & 3 deletions lib/internal/util/inspect.js
Original file line number Diff line number Diff line change
Expand Up @@ -309,16 +309,17 @@ function inspect(value, opts) {
if (typeof opts === 'boolean') {
ctx.showHidden = opts;
} else if (opts) {
const optKeys = ObjectKeys(opts);
for (const key of optKeys) {
for (const key in opts) {
// 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 (ctx.userOptions === undefined) {
} else if (
ObjectPrototypeHasOwnProperty(opts, key) &&
ctx.userOptions === undefined) {
// This is required to pass through the actual user input.
ctx.userOptions = opts;
}
Expand Down