GitHub
12/03/2024, 5:52 AMJsArrayBuffer::external
and JsBuffer::external (https://github.com/neon-bindings/neon/pull/897).
Thanks to @Cassy343 for finding the issue!
In previous versions of Neon, it was possible to create a JsArrayBuffer or JsBuffer that references data without the 'static lifetime.
pub fn soundness_hole(mut cx: FunctionContext) -> JsResult<JsArrayBuffer> {
let mut data = vec![0u8, 1, 2, 3];
// Creating an external from &mut [u8] instead of Vec<u8> since there is a blanket impl
// of AsMut<T> for &mut T
let buf = JsArrayBuffer::external(&mut cx, data.as_mut_slice());
// buf is still holding a reference to data!
drop(data);
Ok(buf)
}
`v0.10.0`
Compare Source
See the <MIGRATION_GUIDE_0.10.md|Neon 0.10 Migration Guide> for more details about new features and breaking changes.
Features
• New buffer borrowing API
• Added JoinHandle for Channel::send
• `JsPromise` and `TaskBuilder`
• Handle panics and exceptions in Channels and Tasks
• Function call / construct builders
and simplify low level call
• Create functions from closures
Minor Improvements
• Performance improvements
• Rename N-API to Node-API in docs to match Node changes
• Remove unused cslice dependency
• Switch to `syn-mid` for faster compile times
• Downcast in `Object::get`
• Added migration guide
• Added `Object::get_opt` and `Object::get_value`
Fixes
• [Safety] Make it harder to store and forge Throw
• [Soundness] Make `JsValue` types `!Copy`
• [Soundness] Tag `Root` with instance id
• create-neon no longer leaves partial project on disk
• Fix legacy backend on Electron and Windows
• FreeBSD support on legacy backend
*Internal Improvem…
pact-foundation/pact-js
✅ All checks have passed
24/24 successful checksGitHub
12/06/2024, 3:04 AM