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: nodejs#30768
Fixes: nodejs#30183
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
  • Loading branch information
BridgeAR committed Jan 20, 2020
1 parent 62ed6a2 commit 7d19aba
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 @@ -118,7 +118,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 7d19aba

Please sign in to comment.