From 0bb8cc9090a1bb6d424fe0bb81bf32a7aac769ed Mon Sep 17 00:00:00 2001 From: Daeyeon Jeong Date: Tue, 29 Nov 2022 20:22:49 +0900 Subject: [PATCH] lib: disambiguate `native module` to `binding` Signed-off-by: Daeyeon Jeong PR-URL: https://github.com/nodejs/node/pull/45673 Refs: https://github.com/nodejs/node/pull/44135 Reviewed-By: Chengzhong Wu Reviewed-By: Luigi Pinca Reviewed-By: Joyee Cheung --- lib/internal/bootstrap/node.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/internal/bootstrap/node.js b/lib/internal/bootstrap/node.js index 108b11a2f960d2..c97beef6e42df4 100644 --- a/lib/internal/bootstrap/node.js +++ b/lib/internal/bootstrap/node.js @@ -162,9 +162,12 @@ const deprecationHandler = { } }; +// process.config is serialized config.gypi +const binding = internalBinding('builtins'); + // eslint-disable-next-line node-core/prefer-primordials let processConfig = new Proxy( - JSONParse(nativeModule.config), + JSONParse(binding.config), deprecationHandler); ObjectDefineProperty(process, 'config', { @@ -310,7 +313,7 @@ const features = { // This needs to be dynamic because --no-node-snapshot disables the // code cache even if the binary is built with embedded code cache. get cached_builtins() { - return nativeModule.hasCachedBuiltins(); + return binding.hasCachedBuiltins(); } };