A few fixes related to CommonJS module loading (#9540)

* Ensure we always deref the source code

* Move more work to concurrent transpiler

* Update NodeModuleModule.h

* Update string.zig

* Make `Bun.gc()` more effective

* Update text-loader-fixture-dynamic-import-stress.ts

* Update ZigSourceProvider.cpp

* Fixes #6946

* Update ModuleLoader.cpp

* Update ModuleLoader.cpp

* Fixes #8965

* Fixups

* Update ModuleLoader.cpp

* Update ModuleLoader.cpp

* Load it

* Update module_loader.zig

* Update module_loader.zig

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
This commit is contained in:
Jarred Sumner
2024-03-21 10:42:57 -07:00
committed by GitHub
parent 0948727243
commit e124f08caf
27 changed files with 428 additions and 189 deletions

View File

@@ -124,7 +124,7 @@ JSC_DEFINE_HOST_FUNCTION(jsFunctionNodeModuleModuleConstructor,
}
auto *out = Bun::JSCommonJSModule::create(vm, structure, idString, jsNull(),
dirname, nullptr);
dirname, SourceCode());
if (!parentValue.isUndefined())
out->putDirect(vm, JSC::Identifier::fromString(vm, "parent"_s), parentValue,