Skip to content

Commit

Permalink
util: fix built-in detection
Browse files Browse the repository at this point in the history
This makes sure that the regular expression matches all built-in
objects properly. So far a couple where missed.

PR-URL: #30768
Fixes: #30183
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
  • Loading branch information
BridgeAR authored and MylesBorins committed Dec 17, 2019
1 parent f371562 commit 453be95
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/internal/util/inspect.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ const { NativeModule } = require('internal/bootstrap/loaders');
let hexSlice;

const builtInObjects = new Set(
ObjectGetOwnPropertyNames(global).filter((e) => /^([A-Z][a-z]+)+$/.test(e))
ObjectGetOwnPropertyNames(global).filter((e) => /^[A-Z][a-zA-Z0-9]+$/.test(e))
);

// These options must stay in sync with `getUserOptions`. So if any option will
Expand Down

0 comments on commit 453be95

Please sign in to comment.