From 453be95edc2eb224c7b896808db679d44627c214 Mon Sep 17 00:00:00 2001 From: Ruben Bridgewater Date: Sat, 30 Nov 2019 13:33:18 +0100 Subject: [PATCH] util: fix built-in detection MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-By: Michaƫl Zasso --- lib/internal/util/inspect.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/internal/util/inspect.js b/lib/internal/util/inspect.js index c621997c64be44..8e2c0a71613f44 100644 --- a/lib/internal/util/inspect.js +++ b/lib/internal/util/inspect.js @@ -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