Sitelet https://web.archive.org/web/20220709153723/https://github.com/Jarred-Sumner/bun/issues/131
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test failure in path.join #131

Open
Jarred-Sumner opened this issue Mar 19, 2022 · 0 comments
Open

Test failure in path.join #131

Jarred-Sumner opened this issue Mar 19, 2022 · 0 comments
Labels
bug good first issue

Comments

@Jarred-Sumner
Copy link
Owner

@Jarred-Sumner Jarred-Sumner commented Mar 19, 2022

Currently, path.join has a failing test:
image

These tests are taken from Node, so it likely is a real bug

The code implementing path.join is in this file:

pub fn joinStringBuf(buf: []u8, _parts: anytype, comptime _platform: Platform) []const u8 {
if (FeatureFlags.use_std_path_join) {
var alloc = std.heap.FixedBufferAllocator.init(buf);
return std.fs.path.join(&alloc.allocator, _parts) catch unreachable;
}
var written: usize = 0;

The code wiring up path.join to JavaScript is here:

pub fn join(
globalThis: *JSC.JSGlobalObject,
isWindows: bool,
args_ptr: [*]JSC.JSValue,
args_len: u16,
) callconv(.C) JSC.JSValue {
if (comptime is_bindgen) return JSC.JSValue.jsUndefined();
if (args_len == 0) return JSC.ZigString.init("").toValue(globalThis);
var stack_fallback_allocator = std.heap.stackFallback(
(32 * @sizeOf(string)),
heap_allocator,
);
var allocator = stack_fallback_allocator.get();
var arena = std.heap.ArenaAllocator.init(heap_allocator);

@Jarred-Sumner Jarred-Sumner added bug good first issue labels Mar 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug good first issue
Projects
None yet
Development

No branches or pull requests

1 participant