diff options
author | 2023-09-21 18:59:01 -0700 | |
---|---|---|
committer | 2023-09-21 18:59:01 -0700 | |
commit | e34ff6133908d0f975e13f943cd434f28b74a9a6 (patch) | |
tree | 70b03ed9e0edea22cd733ad4a5785519ec5eff59 /src/bun.js | |
parent | 8684a590290b65a23626df67791d7b54eaf4ccaf (diff) | |
download | bun-e34ff6133908d0f975e13f943cd434f28b74a9a6.tar.gz bun-e34ff6133908d0f975e13f943cd434f28b74a9a6.tar.zst bun-e34ff6133908d0f975e13f943cd434f28b74a9a6.zip |
Don't use arena in node:fs (#5863)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Diffstat (limited to 'src/bun.js')
-rw-r--r-- | src/bun.js/node/node_fs.zig | 12 | ||||
-rw-r--r-- | src/bun.js/node/node_fs_stat_watcher.zig | 2 | ||||
-rw-r--r-- | src/bun.js/node/types.zig | 2 |
3 files changed, 8 insertions, 8 deletions
diff --git a/src/bun.js/node/node_fs.zig b/src/bun.js/node/node_fs.zig index 752d0e2fb..a07e75ee2 100644 --- a/src/bun.js/node/node_fs.zig +++ b/src/bun.js/node/node_fs.zig @@ -1074,7 +1074,7 @@ pub const Arguments = struct { } pub fn fromJS(ctx: JSC.C.JSContextRef, arguments: *ArgumentsSlice, exception: JSC.C.ExceptionRef) ?Stat { - const path = PathLike.fromJSWithAllocator(ctx, arguments, bun.default_allocator, exception) orelse { + const path = PathLike.fromJS(ctx, arguments, exception) orelse { if (exception.* == null) { JSC.throwInvalidArguments( "path must be a string or TypedArray", @@ -1649,7 +1649,7 @@ pub const Arguments = struct { } pub fn fromJS(ctx: JSC.C.JSContextRef, arguments: *ArgumentsSlice, exception: JSC.C.ExceptionRef) ?Readdir { - const path = PathLike.fromJSWithAllocator(ctx, arguments, bun.default_allocator, exception) orelse { + const path = PathLike.fromJS(ctx, arguments, exception) orelse { if (exception.* == null) { JSC.throwInvalidArguments( "path must be a string or TypedArray", @@ -2917,7 +2917,7 @@ pub const Arguments = struct { } pub fn fromJS(ctx: JSC.C.JSContextRef, arguments: *ArgumentsSlice, exception: JSC.C.ExceptionRef) ?CopyFile { - const src = PathLike.fromJSWithAllocator(ctx, arguments, bun.default_allocator, exception) orelse { + const src = PathLike.fromJS(ctx, arguments, exception) orelse { if (exception.* == null) { JSC.throwInvalidArguments( "src must be a string or buffer", @@ -2931,7 +2931,7 @@ pub const Arguments = struct { if (exception.* != null) return null; - const dest = PathLike.fromJSWithAllocator(ctx, arguments, bun.default_allocator, exception) orelse { + const dest = PathLike.fromJS(ctx, arguments, exception) orelse { src.deinit(); if (exception.* == null) { @@ -2981,7 +2981,7 @@ pub const Arguments = struct { } pub fn fromJS(ctx: JSC.C.JSContextRef, arguments: *ArgumentsSlice, exception: JSC.C.ExceptionRef) ?Cp { - const src = PathLike.fromJSWithAllocator(ctx, arguments, bun.default_allocator, exception) orelse { + const src = PathLike.fromJS(ctx, arguments, exception) orelse { if (exception.* == null) { JSC.throwInvalidArguments( "src must be a string or buffer", @@ -2995,7 +2995,7 @@ pub const Arguments = struct { if (exception.* != null) return null; - const dest = PathLike.fromJSWithAllocator(ctx, arguments, bun.default_allocator, exception) orelse { + const dest = PathLike.fromJS(ctx, arguments, exception) orelse { defer src.deinit(); if (exception.* == null) { JSC.throwInvalidArguments( diff --git a/src/bun.js/node/node_fs_stat_watcher.zig b/src/bun.js/node/node_fs_stat_watcher.zig index c2690c200..3bf262f07 100644 --- a/src/bun.js/node/node_fs_stat_watcher.zig +++ b/src/bun.js/node/node_fs_stat_watcher.zig @@ -198,7 +198,7 @@ pub const StatWatcher = struct { pub fn fromJS(ctx: JSC.C.JSContextRef, arguments: *ArgumentsSlice, exception: JSC.C.ExceptionRef) ?Arguments { const vm = ctx.vm(); - const path = PathLike.fromJS(ctx, arguments, exception) orelse { + const path = PathLike.fromJSWithAllocator(ctx, arguments, bun.default_allocator, exception) orelse { if (exception.* == null) { JSC.throwInvalidArguments( "filename must be a string or TypedArray", diff --git a/src/bun.js/node/types.zig b/src/bun.js/node/types.zig index 7e9cdcd2d..4a650dbaf 100644 --- a/src/bun.js/node/types.zig +++ b/src/bun.js/node/types.zig @@ -802,7 +802,7 @@ pub const PathLike = union(Tag) { } pub fn fromJS(ctx: JSC.C.JSContextRef, arguments: *ArgumentsSlice, exception: JSC.C.ExceptionRef) ?PathLike { - return fromJSWithAllocator(ctx, arguments, arguments.arena.allocator(), exception); + return fromJSWithAllocator(ctx, arguments, bun.default_allocator, exception); } pub fn fromJSWithAllocator(ctx: JSC.C.JSContextRef, arguments: *ArgumentsSlice, allocator: std.mem.Allocator, exception: JSC.C.ExceptionRef) ?PathLike { const arg = arguments.next() orelse return null; |