diff options
author | 2023-05-26 03:32:28 -0700 | |
---|---|---|
committer | 2023-05-26 03:32:28 -0700 | |
commit | 0f2a79b9c1a5b0142f8099e94712799607e8990f (patch) | |
tree | 99077706398898df3abda3a9a45a9abc0093e8fc /src/bun.js/api/JSTranspiler.zig | |
parent | 62f05ec1037009cc1724674277df82f1a9ec75ab (diff) | |
download | bun-0f2a79b9c1a5b0142f8099e94712799607e8990f.tar.gz bun-0f2a79b9c1a5b0142f8099e94712799607e8990f.tar.zst bun-0f2a79b9c1a5b0142f8099e94712799607e8990f.zip |
Fix crash in test.todo + remove JSC C API usages in bun:test (#3079)
* Fix crash in test.todo
* remove usages of JSC C API in bun:test
* Remove additional JSC-C API usages
* fix `make headers`
* URLSearchParams.length
* FormData length
* URLSearchParams length
* Fix `make headers`
* very fancy length
* Fix bug with exceptions being ignored sometimes
* Add tests for extension toHaveLength
---------
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Diffstat (limited to 'src/bun.js/api/JSTranspiler.zig')
-rw-r--r-- | src/bun.js/api/JSTranspiler.zig | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/bun.js/api/JSTranspiler.zig b/src/bun.js/api/JSTranspiler.zig index fecce60cd..8a59f59e7 100644 --- a/src/bun.js/api/JSTranspiler.zig +++ b/src/bun.js/api/JSTranspiler.zig @@ -385,7 +385,7 @@ fn transformOptionsFromJSC(globalObject: JSC.C.JSContextRef, temp_allocator: std single_external[0] = std.fmt.allocPrint(allocator, "{}", .{external}) catch unreachable; transpiler.transform.external = single_external; } else if (toplevel_type.isArray()) { - const count = external.getLengthOfArray(globalThis); + const count = external.getLength(globalThis); if (count == 0) break :external; var externals = allocator.alloc(string, count) catch unreachable; @@ -606,7 +606,7 @@ fn transformOptionsFromJSC(globalObject: JSC.C.JSContextRef, temp_allocator: std var length_iter = iter; while (length_iter.next()) |value| { if (value.isString()) { - const length = @truncate(u32, value.getLengthOfArray(globalThis)); + const length = @truncate(u32, value.getLength(globalThis)); string_count += @as(u32, @boolToInt(length > 0)); total_name_buf_len += length; } @@ -679,7 +679,7 @@ fn transformOptionsFromJSC(globalObject: JSC.C.JSContextRef, temp_allocator: std continue; } - if (value.isObject() and value.getLengthOfArray(globalObject) == 2) { + if (value.isObject() and value.getLength(globalObject) == 2) { const replacementValue = JSC.JSObject.getIndex(value, globalThis, 1); if (exportReplacementValue(replacementValue, globalThis)) |to_replace| { const replacementKey = JSC.JSObject.getIndex(value, globalThis, 0); |