mirror of
https://github.com/oven-sh/bun
synced 2026-02-16 13:51:47 +00:00
Set require("module").globalPaths to empty array
https://github.com/oven-sh/bun/issues/1641#issuecomment-1427017442
This commit is contained in:
@@ -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(
|
||||
|
||||
5
test/bun.js/node-module-module.test.js
Normal file
5
test/bun.js/node-module-module.test.js
Normal file
@@ -0,0 +1,5 @@
|
||||
import { expect, test } from "bun:test";
|
||||
|
||||
test("module.globalPaths exists", () => {
|
||||
expect(Array.isArray(require("module").globalPaths)).toBe(true);
|
||||
});
|
||||
Reference in New Issue
Block a user