diff options
author | 2023-06-18 10:47:42 -0700 | |
---|---|---|
committer | 2023-06-18 10:47:42 -0700 | |
commit | fdb7940c4e435a5b7f5a368f4168d748baf6b5b6 (patch) | |
tree | ee23b0ee654cb7ff9307ccc1db961fed444e01f6 /src/bun.js/base.zig | |
parent | 873f615358b78f913b3f8fe6adda47da7e6e57ac (diff) | |
download | bun-fdb7940c4e435a5b7f5a368f4168d748baf6b5b6.tar.gz bun-fdb7940c4e435a5b7f5a368f4168d748baf6b5b6.tar.zst bun-fdb7940c4e435a5b7f5a368f4168d748baf6b5b6.zip |
Fix a bunch of bugs (#3352)
* Fix a bunch of bugs
* undo that one
* Fix crash in readdir()
* woops
* woops
* Add comment
* :scissors:
* Make `readlink()` and `realpath` use much less memory
* Update BunString.cpp
* woopsie
* Unnecessary
* Don't commit these
---------
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Diffstat (limited to '')
-rw-r--r-- | src/bun.js/base.zig | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/bun.js/base.zig b/src/bun.js/base.zig index 4e3e83bd7..038f7f38b 100644 --- a/src/bun.js/base.zig +++ b/src/bun.js/base.zig @@ -207,6 +207,15 @@ pub const To = struct { return array; }, + []const bun.String => { + defer { + for (value) |out| { + out.deref(); + } + bun.default_allocator.free(value); + } + return bun.String.toJSArray(context, value).asObjectRef(); + }, []const PathString, []const []const u8, []const []u8, [][]const u8, [][:0]const u8, [][:0]u8 => { if (value.len == 0) return JSC.C.JSObjectMakeArray(context, 0, null, exception); |