aboutsummaryrefslogtreecommitdiff
path: root/src/bun.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/bun.js')
-rw-r--r--src/bun.js/node/node_fs.zig12
-rw-r--r--src/bun.js/node/node_fs_stat_watcher.zig2
-rw-r--r--src/bun.js/node/types.zig2
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;