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.

Backport-PR-URL: #31431
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 Jan 30, 2020
1 parent bbf39bc commit 40a724c
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 40a724c

Please sign in to comment.