8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 850d357 commit f2ac4bbCopy full SHA for f2ac4bb
lib/internal/modules/cjs/loader.js
@@ -233,9 +233,9 @@ ObjectDefineProperty(Module, 'wrapper', {
233
}
234
});
235
236
-ObjectDefineProperty(Module.prototype, 'isPreloading', {
237
- get() { return isPreloading; }
238
-});
+const isPreloadingDesc = { get() { return isPreloading; } };
+ObjectDefineProperty(Module.prototype, 'isPreloading', isPreloadingDesc);
+ObjectDefineProperty(NativeModule.prototype, 'isPreloading', isPreloadingDesc);
239
240
function getModuleParent() {
241
return moduleParentCache.get(this);
lib/internal/test/binding.js
@@ -4,4 +4,9 @@ process.emitWarning(
4
'These APIs are for internal testing only. Do not use them.',
5
'internal/test/binding');
6
7
-module.exports = { internalBinding };
+if (module.isPreloading) {
8
+ globalThis.internalBinding = internalBinding;
9
+ globalThis.primordials = primordials;
10
+}
11
+
12
+module.exports = { internalBinding, primordials };