aboutsummaryrefslogtreecommitdiff
path: root/src/bun.js
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2023-02-12 04:35:52 -0800
committerGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2023-02-12 04:35:52 -0800
commit83473c60df3b7ff4c2326573aa8532b636de4b4e (patch)
tree3f440eecedc8d0b46c4cac3e6b77ddc1e4d5c326 /src/bun.js
parent8b4e58f3d225e30d186fc2d208dea477a2f9b5a5 (diff)
downloadbun-83473c60df3b7ff4c2326573aa8532b636de4b4e.tar.gz
bun-83473c60df3b7ff4c2326573aa8532b636de4b4e.tar.zst
bun-83473c60df3b7ff4c2326573aa8532b636de4b4e.zip
Set `require("module").globalPaths` to empty array
https://github.com/oven-sh/bun/issues/1641#issuecomment-1427017442
Diffstat (limited to 'src/bun.js')
-rw-r--r--src/bun.js/modules/NodeModuleModule.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/bun.js/modules/NodeModuleModule.cpp b/src/bun.js/modules/NodeModuleModule.cpp
index 01e061499..eee9460ae 100644
--- a/src/bun.js/modules/NodeModuleModule.cpp
+++ b/src/bun.js/modules/NodeModuleModule.cpp
@@ -162,6 +162,9 @@ void generateNodeModuleModule(JSC::JSGlobalObject *globalObject,
exportNames.append(JSC::Identifier::fromString(vm, "builtinModules"_s));
+ exportNames.append(JSC::Identifier::fromString(vm, "globalPaths"_s));
+ exportValues.append(JSC::constructEmptyArray(globalObject, 0));
+
JSC::JSArray *builtinModules = JSC::JSArray::create(
vm,
globalObject->arrayStructureForIndexingTypeDuringAllocation(