Correctly handle __esModule for loader: "object" (#16885)

Co-authored-by: Jarred-Sumner <709451+Jarred-Sumner@users.noreply.github.com>
This commit is contained in:
Jarred Sumner
2025-01-31 05:24:33 -08:00
committed by GitHub
parent 25f6cbd471
commit 9acb72d2ad
4 changed files with 82 additions and 7 deletions

View File

@@ -11,13 +11,14 @@ generateObjectModuleSourceCode(JSC::JSGlobalObject* globalObject,
Vector<JSC::Identifier, 4>& exportNames,
JSC::MarkedArgumentBuffer& exportValues) -> void {
auto& vm = JSC::getVM(lexicalGlobalObject);
GlobalObject* globalObject = reinterpret_cast<GlobalObject*>(lexicalGlobalObject);
auto throwScope = DECLARE_THROW_SCOPE(vm);
GlobalObject* globalObject = defaultGlobalObject(lexicalGlobalObject);
JSC::EnsureStillAliveScope stillAlive(object);
PropertyNameArray properties(vm, PropertyNameMode::Strings,
PrivateSymbolMode::Exclude);
object->getPropertyNames(globalObject, properties,
DontEnumPropertiesMode::Exclude);
object->methodTable()->getOwnPropertyNames(object, globalObject, properties, DontEnumPropertiesMode::Exclude);
RETURN_IF_EXCEPTION(throwScope, void());
gcUnprotectNullTolerant(object);
for (auto& entry : properties) {