mirror of
https://github.com/oven-sh/bun
synced 2026-02-23 01:01:47 +00:00
Set exports to {} in user-constructed CommonJSModuleRecords (#4076)
This commit is contained in:
@@ -138,6 +138,10 @@ JSC_DEFINE_HOST_FUNCTION(jsFunctionNodeModuleModuleConstructor,
|
||||
out->putDirect(vm, JSC::Identifier::fromString(vm, "parent"_s), parentValue,
|
||||
0);
|
||||
|
||||
out->putDirect(vm, JSC::Identifier::fromString(vm, "exports"_s),
|
||||
JSC::constructEmptyObject(globalObject,
|
||||
globalObject->objectPrototype(), 0),
|
||||
0);
|
||||
return JSValue::encode(out);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user