Skip to content

Commit

Permalink
fixup! util: prefer Reflect.ownKeys(…)
Browse files Browse the repository at this point in the history
  • Loading branch information
ExE-Boss committed Jan 19, 2021
1 parent af9e0e3 commit 6c88555
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/internal/util/inspect.js
Original file line number Diff line number Diff line change
Expand Up @@ -660,10 +660,12 @@ function getPrefix(constructor, tag, fallback, size = '') {
// Look up the keys of the object.
function getKeys(value, showHidden) {
let keys;
const symbols = ObjectGetOwnPropertySymbols(value);
if (showHidden) {
keys = ReflectOwnKeys(value);
keys = ObjectGetOwnPropertyNames(value);
if (symbols.length !== 0)
ArrayPrototypePush(keys, ...symbols);
} else {
const symbols = ObjectGetOwnPropertySymbols(value);
// This might throw if `value` is a Module Namespace Object from an
// unevaluated module, but we don't want to perform the actual type
// check because it's expensive.
Expand Down

0 comments on commit 6c88555

Please sign in to comment.