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:
Ruben Bridgewater committed 2019-12-13 19:57:31 +01:00
1 parent 654d22ccf4
commit 28ee032fca
1 file changed
+1 -1
+1 -1
View File
@@ -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