webpack test and add empty prototype prop to module (#3421)

This commit is contained in:
Dylan Conway
2023-06-26 19:16:59 -07:00
committed by GitHub
parent 4be15cff02
commit 4e4cae0fc3
6 changed files with 57 additions and 4 deletions

View File

@@ -142,10 +142,10 @@ void generateNodeModuleModule(JSC::JSGlobalObject *globalObject,
exportValues.append(
jsCast<Zig::GlobalObject *>(globalObject)->lazyRequireCacheObject());
exportNames.append(JSC::Identifier::fromString(vm, "builtinModules"_s));
exportNames.append(JSC::Identifier::fromString(vm, "prototype"_s));
exportValues.append(constructEmptyObject(globalObject));
exportNames.append(JSC::Identifier::fromString(vm, "globalPaths"_s));
exportValues.append(JSC::constructEmptyArray(globalObject, 0));
exportNames.append(JSC::Identifier::fromString(vm, "builtinModules"_s));
JSC::JSArray *builtinModules = JSC::JSArray::create(
vm,
@@ -167,5 +167,8 @@ void generateNodeModuleModule(JSC::JSGlobalObject *globalObject,
builtinModules->putDirectIndex(globalObject, 6,
JSC::jsString(vm, String("bun:sqlite"_s)));
exportValues.append(builtinModules);
exportNames.append(JSC::Identifier::fromString(vm, "globalPaths"_s));
exportValues.append(JSC::constructEmptyArray(globalObject, 0));
}
} // namespace Zig