mirror of
https://github.com/oven-sh/bun
synced 2026-02-09 18:38:55 +00:00
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:
@@ -121,6 +121,13 @@ pub const WTFStringImplStruct = extern struct {
|
||||
return ZigString.Slice.init(this.refCountAllocator(), this.latin1Slice());
|
||||
}
|
||||
|
||||
extern fn Bun__WTFStringImpl__ensureHash(this: WTFStringImpl) void;
|
||||
/// Compute the hash() if necessary
|
||||
pub fn ensureHash(this: WTFStringImpl) void {
|
||||
JSC.markBinding(@src());
|
||||
Bun__WTFStringImpl__ensureHash(this);
|
||||
}
|
||||
|
||||
pub fn toUTF8(this: WTFStringImpl, allocator: std.mem.Allocator) ZigString.Slice {
|
||||
if (this.is8Bit()) {
|
||||
if (bun.strings.toUTF8FromLatin1(allocator, this.latin1Slice()) catch bun.outOfMemory()) |utf8| {
|
||||
|
||||
Reference in New Issue
Block a user