mirror of https://github.com/nodejs/node.git
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: https://github.com/nodejs/node/pull/30768 Fixes: https://github.com/nodejs/node/issues/30183 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
This commit is contained in:
parent
654d22ccf4
commit
28ee032fca
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue