Jarred Sumner
d7a725952d
ci: don't include BUN_INSPECT_CONNECT_TO in bunEnv
2025-08-15 13:40:00 -07:00
Kai Tamkun
37a207e2a4
NAPI fixes ( #21775 )
...
### What does this PR do?
Defers exceptions thrown by NAPI code until execution returns/flows to
JS code.
### How did you verify your code works?
Ran existing NAPI tests and added to napi.test.ts.
2025-08-12 19:59:34 -07:00
Dylan Conway
c3c2dccc55
Fix N-API BigInt word count issue ( #21652 )
...
## Summary
Fixes a bug in napi_get_value_bigint_words where the function would
return the number of words copied instead of the actual word count
needed when the provided buffer is smaller than required.
## The Problem
When napi_get_value_bigint_words was called with a buffer smaller than
the actual BigInt size, it would incorrectly return the buffer size
instead of the actual word count needed. This doesn't match Node.js
behavior.
### Example
BigInt that requires 2 words: 0x123456789ABCDEF0123456789ABCDEFn
Call with buffer for only 1 word
- Before fix: word_count = 1 (buffer size)
- After fix: word_count = 2 (actual words needed)
## The Fix
Changed napi_get_value_bigint_words to always set word_count to the
actual number of words in the BigInt, regardless of buffer size.
## Test Plan
- Added test test_bigint_word_count that verifies the word count is
correctly returned
- Added test test_ref_unref_underflow for the existing
napi_reference_unref underflow protection
- Both tests pass with the fix and match Node.js behavior
🤖 Generated with [Claude Code](https://claude.ai/code )
---------
Co-authored-by: Claude <noreply@anthropic.com >
2025-08-07 18:15:12 -07:00
190n
03dfd7d96b
Run callback passed to napi_module_register after dlopen returns instead of during call ( #20478 )
2025-07-24 11:46:56 -07:00
Jarred Sumner
8b321cc1c6
Match Node.js v24 behavior for napi_get_value_string_utf8 handling of NAPI_AUTO_LENGTH ( #20698 )
...
Co-authored-by: Claude <noreply@anthropic.com >
2025-07-02 20:10:08 -07:00
190n
172aecb02e
[publish images] Upgrade self-reported Node.js version from 22.6.0 to 24.3.0 (v2) ( #20772 )
...
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com >
Co-authored-by: Claude <noreply@anthropic.com >
Co-authored-by: Jarred-Sumner <709451+Jarred-Sumner@users.noreply.github.com >
Co-authored-by: Meghan Denny <meghan@bun.sh >
Co-authored-by: Ashcon Partovi <ashcon@partovi.net >
Co-authored-by: pfg <pfg@pfg.pw >
Co-authored-by: pfgithub <6010774+pfgithub@users.noreply.github.com >
Co-authored-by: Ciro Spaciari <ciro.spaciari@gmail.com >
Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
2025-07-02 12:06:08 -07:00
Ben Grant
ea57037567
Revert "Upgrade self-reported Node.js version from 22.6.0 to 24.3.0 ( #20659 ) [publish images]"
...
This reverts commit 80309e4d59 . It breaks the Windows CI.
2025-07-02 09:40:32 -07:00
Jarred Sumner
80309e4d59
Upgrade self-reported Node.js version from 22.6.0 to 24.3.0 ( #20659 ) [publish images]
...
Co-authored-by: Claude <noreply@anthropic.com >
Co-authored-by: Jarred-Sumner <709451+Jarred-Sumner@users.noreply.github.com >
Co-authored-by: Meghan Denny <meghan@bun.sh >
Co-authored-by: Ashcon Partovi <ashcon@partovi.net >
Co-authored-by: pfg <pfg@pfg.pw >
Co-authored-by: pfgithub <6010774+pfgithub@users.noreply.github.com >
Co-authored-by: Ciro Spaciari <ciro.spaciari@gmail.com >
Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
Co-authored-by: Ben Grant <ben@bun.sh >
2025-07-02 00:03:05 -07:00
pfg
3223da2734
ReadableStream .text(), .json(), .arrayBuffer(), .bytes() ( #20694 )
...
Co-authored-by: pfgithub <6010774+pfgithub@users.noreply.github.com >
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com >
2025-06-28 00:27:57 -07:00
Jarred Sumner
9081073ec4
Deflake napi.test.ts
2025-06-27 17:59:05 -07:00
Jarred Sumner
bc79a48ce4
Fix crash in NapiClass_ConstructorFunction due to incorrect handling of newTarget ( #20552 )
...
Co-authored-by: Dylan Conway <dylan.conway567@gmail.com >
2025-06-23 19:50:09 -07:00
Jarred Sumner
197c7abe7d
Make the napi/v8 tests compile faster ( #20555 )
2025-06-21 23:57:04 -07:00
Jarred Sumner
653c459660
Fix asan failure in napi_async_work caused by accessing napi_async_work after freed ( #20554 )
2025-06-21 23:56:40 -07:00
Ben Grant
1ebec90d6e
Revert "Add test from #18287 ( #19775 )"
...
This reverts commit f1504c4265 .
2025-05-20 12:22:01 -07:00
190n
f1504c4265
Add test from #18287 ( #19775 )
2025-05-20 11:56:30 -07:00
Jarred Sumner
64ed68c9e0
Delete .node files from bun build --compile after dlopen ( #19551 )
...
Co-authored-by: 190n <ben@bun.sh >
2025-05-09 21:26:28 -07:00
cc
181da96604
compatibility: invalid arg error if error is nullptr in napi_throw ( #19283 )
2025-04-25 18:21:44 -07:00
Dylan Conway
ba0bd426ed
deflake napi_async_work test ( #18836 )
2025-04-07 18:52:05 -07:00
Dylan Conway
340ae94d0f
napi_async_work fixes (#18825 )
2025-04-07 05:20:24 -07:00
190n
8ebd5d53da
Skip flaky macOS x64 node-napi tests in CI ( #18448 )
2025-03-24 23:49:14 -07:00
190n
cde668b54c
Better edge case handling in napi_value<->String conversion ( #18107 )
2025-03-12 18:15:00 -07:00
Zack Radisic
28ebbb3f20
Fix node:vm test ( #18081 )
2025-03-12 14:16:03 -07:00
190n
efabdcbe1f
Start fixing bugs discovered by Node.js's Node-API tests ( #14501 )
...
Co-authored-by: Kai Tamkun <kai@tamkun.io >
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com >
Co-authored-by: Ashcon Partovi <ashcon@partovi.net >
Co-authored-by: Ciro Spaciari <ciro.spaciari@gmail.com >
Co-authored-by: Dylan Conway <35280289+dylan-conway@users.noreply.github.com >
Co-authored-by: 190n <190n@users.noreply.github.com >
2025-02-26 22:11:42 -08:00
190n
a8d159da22
Fix napi_is_buffer/napi_is_typedarray to match Node.js ( #17034 )
2025-02-03 21:49:27 -08:00
190n
af27f9e697
Allow WTF timers to participate in the event loop ( #15557 )
...
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com >
Co-authored-by: 190n <190n@users.noreply.github.com >
Co-authored-by: 190n <7763597+190n@users.noreply.github.com >
2025-01-28 17:47:53 -08:00
190n
71eb1476db
Fix crash when napi_register_module_v1 returns nullptr ( #16816 )
2025-01-27 20:13:22 -08:00
Meghan Denny
af79cebf9e
unflag experimental css and html ( #16561 )
...
Co-authored-by: nektro <5464072+nektro@users.noreply.github.com >
Co-authored-by: Zack Radisic <56137411+zackradisic@users.noreply.github.com >
2025-01-21 06:44:54 -08:00
Don Isaac
c3c27b8e0d
fix(napi): napi_get_value_uint32 now handles int32s correctly
2025-01-18 12:08:26 -08:00
190n
72c9c2bc21
Set error code in Node-API functions ( #16223 )
2025-01-07 20:23:58 -08:00
dave caruso
41924211f2
add throw: true in Bun.build, to be made default in 1.2 ( #15861 )
2024-12-18 19:27:59 -08:00
190n
59e06b0df5
fix(napi): set lossless parameter in napi_get_value_bigint_{int64,uint64}, and trim leading zeroes in napi_create_bigint_words ( #15804 )
2024-12-17 17:38:12 -08:00
190n
4eae3a90e8
fix(napi): Make napi_wrap work on regular objects ( #15622 )
...
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com >
2024-12-16 15:54:39 -08:00
190n
9647291d73
Implement NAPI type tagging ( #14915 )
2024-10-30 19:57:48 -07:00
190n
50e9be0dc7
Fix napi_value<=>integer conversions and napi_create_empty_array ( #14479 )
2024-10-10 23:50:39 -07:00
190n
50bb5fa1f6
Fix napi_throw_*/napi_create_*_error ( #14446 )
2024-10-10 02:35:38 -07:00
190n
b0b38b42ba
Return undefined from napi_get_property when property does not exist ( #14366 )
2024-10-07 18:05:31 -07:00
190n
0a54c24bd3
Allow throwing exceptions from napi_async_complete_callback ( #14302 )
...
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com >
Co-authored-by: Jarred-Sumner <Jarred-Sumner@users.noreply.github.com >
2024-10-02 22:35:45 -07:00
Jarred Sumner
94a656bc4f
Support bundling .node files in ESM & CJS when targeting Node.js ( #14294 )
...
Co-authored-by: Jarred-Sumner <Jarred-Sumner@users.noreply.github.com >
2024-10-02 20:15:29 -07:00
190n
dd12715071
Propagate exceptions in napi_run_script ( #14222 )
2024-09-27 22:27:57 -07:00
190n
08a77267da
Keep event loop alive when refConcurrently has been called ( #14068 )
2024-09-20 14:57:55 -07:00
Jarred Sumner
c48997050d
Avoid creating a Napi handle scope within a finalizer ( #13870 )
...
Co-authored-by: Ben Grant <ben@bun.sh >
2024-09-11 20:05:44 -07:00
190n
f6841a06c5
Make NAPI garbage collection tests faster ( #13898 )
2024-09-11 16:59:03 -07:00
190n
282b92d6e1
Fix issues with NAPI tests ( #13831 )
...
Co-authored-by: 190n <190n@users.noreply.github.com >
2024-09-09 17:08:40 -07:00
190n
084734db64
Implement napi_handle_scope and napi_escapable_handle_scope ( #13756 )
2024-09-07 00:55:19 -07:00
Jarred Sumner
cd6785771e
run prettier and add back format action ( #13722 )
2024-09-03 21:32:52 -07:00
190n
dc2929d4e1
Start implementing internal V8 APIs ( #12821 )
...
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com >
2024-08-14 17:51:12 -07:00
Dylan Conway
ac4523e903
fix(napi): unref threadsafe functions on finalize ( #12788 )
2024-07-24 18:57:01 -07:00
Ashcon Partovi
d105b048b1
Use Buildkite for CI ( #11477 )
2024-06-27 14:56:07 -07:00
Jarred Sumner
c082ec5c9d
Fixes #1288 ( #11991 )
2024-06-20 16:14:14 -07:00
Ciro Spaciari
3a5077c622
fix(napi) napi_call_threadsafe_function should work with null data and napi_create_threadsafe_function should keep the process alive by default ( #11952 )
2024-06-18 13:38:04 -07:00