Tags: c4milo/bun
Tags
fix(css): restore handler context after minifying nested rules (oven-… …sh#25997) ## Summary - Fixes handler context not being restored after minifying nested CSS rules - Adds regression test for the issue ## Test plan - [x] Test fails with `USE_SYSTEM_BUN=1 bun test test/regression/issue/25794.test.ts` - [x] Test passes with `bun bd test test/regression/issue/25794.test.ts` Fixes oven-sh#25794 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Bot <claude-bot@bun.sh> Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
fix: v8::Value::IsInt32()/IsUint32() edge cases (oven-sh#25548) ### What does this PR do? - fixes both functions returning false for double-encoded values (even if the numeric value is a valid int32/uint32) - fixes IsUint32() returning false for values that don't fit in int32 - fixes the test from oven-sh#22462 not testing anything (the native functions were being passed a callback to run garbage collection as the first argument, so it was only ever testing what the type check APIs returned for that function) - extends the test to cover the first edge case above ### How did you verify your code works? The new tests fail without these fixes. --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
fix(compile): use 8-byte header for embedded section to ensure byteco… …de alignment (oven-sh#25377) ## Summary - Change the size header in embedded Mach-O and PE sections from `u32` (4 bytes) to `u64` (8 bytes) - Ensures the data payload starts at an 8-byte aligned offset, which is required for the bytecode cache ## Test plan - [x] Test standalone compilation on macOS - [ ] Test standalone compilation on Windows 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
test(ENG-21524): Fuzzilli Stop-Gap (oven-sh#24826) ### What does this PR do? Adds [@mschwarzl's Fuzzilli Support PR](oven-sh#23862) with the changes necessary to be able to: - Run it in CI - Make no impact on `debug` and `release` mode. ### How did you verify your code works? --------- Co-authored-by: Martin Schwarzl <mschwarzl@cloudflare.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: Dylan Conway <dylan.conway567@gmail.com>
ci: run modified tests first (oven-sh#24463) Co-authored-by: Meghan Denny <meghan@bun.com>
Refactor napi_env to use Ref-counted NapiEnv (oven-sh#23940) ### What does this PR do? Replaces raw napi_env pointers with WTF::Ref<NapiEnv> for improved memory management and safety. Updates related classes, function signatures, and finalizer handling to use reference counting. Adds ref/deref methods to NapiEnv and integrates them in Zig and C++ code paths, ensuring proper lifecycle management for N-API environments. ### How did you verify your code works?
feat(sql.array) add support to sql.array (oven-sh#22946) ### What does this PR do? Fixes oven-sh#17030 In this case should work as expected just passing a normal array should be serialized as JSON/JSONB Fixes oven-sh#17798 Insert and update helpers should work as expected here when using sql.array helper: ```sql CREATE TABLE user ( id SERIAL PRIMARY KEY, name VARCHAR NOT NULL, roles TEXT[] ); ``` ```js const item = { id: 1, name: "test", role: sql.array(['a', 'b'], "TEXT") }; await sql` UPDATE user SET ${sql(item)} WHERE id = 1 `; ``` Fixes oven-sh#22281 Should work using sql.array(array, "TEXT") Fixes oven-sh#22165 Fixes oven-sh#22155 Add sql.array(array, typeNameOrTypeID) in Bun.SQL (oven-sh#15088) ### How did you verify your code works? Tests --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Fix Windows shell crash with && operator and external commands (oven-… …sh#22651) ## What does this PR do? Fixes oven-sh#22650 Fixes oven-sh#22615 Fixes oven-sh#22603 Fixes oven-sh#22602 Fixes a crash that occurred when running shell commands through `bun run` (package.json scripts) on Windows that use the `&&` operator followed by an external command. ### The Problem The minimal reproduction was: ```bash bun exec 'echo && node --version' ``` This would crash with: `panic(main thread): attempt to use null value` ### Root Causes Two issues were causing the crash: 1. **Missing top_level_dir**: When `runPackageScriptForeground` creates a MiniEventLoop for running package scripts, it wasn't setting the `top_level_dir` field. This caused a null pointer dereference when the shell tried to access it. 2. **MovableIfWindowsFd handling**: After PR oven-sh#21800 introduced `MovableIfWindowsFd` to handle file descriptor ownership on Windows, the `IOWriter.fd` could be moved to libuv, leaving it null. When the shell tried to spawn an external command after a `&&` operator, it would crash trying to access this null fd. ### The Fix 1. Set `mini.top_level_dir = cwd` after initializing the MiniEventLoop in `run_command.zig` 2. In `IO.zig`, when the fd has been moved to libuv (is null), use `.inherit` for stdio instead of trying to pass the null fd ### How did you verify your code works? - Added a regression test that reproduces the issue - Verified the test fails without the fix and passes with it - Tested the minimal reproduction command directly - The fix correctly allows both commands in the `&&` chain to execute ```bash # Before fix: crashes > bun exec 'echo test && node --version' panic(main thread): attempt to use null value # After fix: works correctly > bun exec 'echo test && node --version' test v22.4.1 ``` <sub> also probably fixes oven-sh#22615 and fixes oven-sh#22603 and fixes oven-sh#22602 </sub> --------- Co-authored-by: Zack Radisic <zack@theradisic.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
PreviousNext