Skip to content

Commit 40a724c

Browse files
BridgeARMylesBorins
authored andcommitted
util: fix built-in detection
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 <[email protected]> Reviewed-By: Michaël Zasso <[email protected]>
1 parent bbf39bc commit 40a724c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/internal/util/inspect.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ const { NativeModule } = require('internal/bootstrap/loaders');
118118
let hexSlice;
119119

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

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

0 commit comments

Comments
 (0)