From 0376e1cf4d08588b941c8e78072f4d8d687db207 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. Backport-PR-URL: https://github.com/nodejs/node/pull/31431 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 38665d1bc2a515..dd8a863a81083c 100644 --- a/lib/internal/util/inspect.js +++ b/lib/internal/util/inspect.js @@ -118,7 +118,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