Skip to content

Commit 453be95

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. PR-URL: #30768 Fixes: #30183 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
1 parent f371562 commit 453be95

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
@@ -116,7 +116,7 @@ const { NativeModule } = require('internal/bootstrap/loaders');
116116
let hexSlice;
117117

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

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

0 commit comments

Comments
 (0)