This commit fixes the build failures that occurred when classes inherit from ErrorInstance by properly implementing the custom heap cell type allocation pattern.
Key changes:
1. Fixed symbol property callback generation in generate-classes.ts by allowing symbol properties with `fn` definitions to generate callbacks while skipping cache/getter/setter processing
2. Implemented proper ErrorInstance inheritance with correct constructor parameters
3. Added custom heap cell type support for ErrorInstance subclasses by using UseCustomHeapCellType::Yes when inheritsFromError is true
4. Added m_heapCellTypeForJSResolveMessage to BunClientData and properly initialized it in the constructor
5. Added ZigGeneratedClasses.h include to BunClientData.cpp to access generated class definitions
The ResolveMessage class now properly inherits from ErrorInstance, allowing it to pass instanceof Error checks and be safely JSON.stringify-ed without heap-use-after-free issues.
All regression tests for resolve-message-json-stringify now pass.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Key changes to make ResolveMessage/BuildMessage proper ErrorInstance objects:
1. **Proper inheritance**: Classes with inheritsFromError:true now inherit from
JSC::ErrorInstance instead of JSC::JSDestructibleObject
2. **Correct subspace allocation**: ErrorInstance classes use built-in error
subspace instead of generating custom subspace methods
3. **Fixed constructor signatures**: ErrorInstance requires ErrorType::Error
parameter in constructor
4. **Fixed finishCreation**: ErrorInstance requires message and cause parameters
for proper initialization
5. **Set ErrorInstanceType**: JSType set to ErrorInstanceType for Error.isError()
to return true
6. **Symbol property handling**: Fixed cached property generation to skip @@
symbol properties that cause C++ syntax errors
This makes ResolveMessage objects proper Error instances that pass both
Error.isError() and instanceof Error checks.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Replace `catch bun.outOfMemory()`, which can accidentally catch
non-OOM-related errors, with either `bun.handleOom` or a manual `catch
|err| switch (err)`.
(For internal tracking: fixes STAB-1070)
---------
Co-authored-by: Dylan Conway <dylan.conway567@gmail.com>
### What does this PR do?
Support sqlite in the Bun.sql API
Fixes#18951Fixes#19701
### How did you verify your code works?
tests
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
### What does this PR do?
Instead of holding a strong for the options object passed with the
handlers, we make each of the callbacks kept alive by the handlers and
it detaches once the detachFromJS function is called.
This should fix#21570, which looks like it was caused by wrapper
functions for AsyncLocalStorage getting collected prematurely.
fixes#21254fixes#21553fixes#21422
### How did you verify your code works?
Ran test/js/node/http2/node-http2.test.js
Previously it accepted `property: anytype` but now it's `[]const u8`
because that was the only allowed value, so it makes it easier to see
what type it accepts in autocomplete.
Also updates the doc comment, switches it to use ZIG_EXPORT, and updates
the cppbind doc comment
### What does this PR do?
`JSPromise.rejectedPromiseValue` does not notify the VM about the promise it creates, meaning unhandled rejections created this way do not trigger `unhandledRejection`. This is leading to accidental error suppression in (likely) a lot of places. Additionally it returns a `JSValue` when really it should be returning a `*JSPromise`, making Zig bindings more type-safe.
This PR renames `rejectedPromiseValue` to `dangerouslyCreateRejectedPromiseValueWithoutNotifyingVM` and marks it as deprecated. It does _not_ modify code calling this function, meaning no behavior changes should occur. We should slowly start replacing its usages with `rejectedPromise`
## Changelog
- Rename `rejectedPromiseValue` to `dangerouslyCreateRejectedPromiseValueWithoutNotifyingVM`
- Mark `JSPromise.asValue` as deprecated. It takes a `*JSGlobalObject` but never uses it. New code should use `toJS()`
- Refactors `blob` to make null checks over `destination_blob.source` a release assertion
- `ErrorBuilder.reject` uses `rejectedPromiseValue` when 1.3 feature flag is enabled