Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions src/jsc/array_buffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,6 @@ unsafe extern "C" {
// safe: `JSGlobalObject` is an opaque `UnsafeCell`-backed ZST handle;
// `&mut *mut u8` is ABI-identical to a non-null `void**` out-param the
// callee fills on success.
safe fn Bun__allocUint8ArrayForCopy(
global: &JSGlobalObject,
len: usize,
out: &mut *mut u8,
) -> JSValue;
safe fn Bun__allocArrayBufferForCopy(
global: &JSGlobalObject,
len: usize,
Expand Down Expand Up @@ -377,11 +372,14 @@ impl ArrayBuffer {
global: &JSGlobalObject,
len: u32,
) -> JsResult<(JSValue, &'a mut [u8])> {
const {
assert!(
KIND.0 == JSType::ArrayBuffer.0,
"ArrayBuffer::alloc: KIND not implemented"
)
};
let mut ptr_out: *mut u8 = ptr::null_mut();
let buf = match KIND {
JSType::Uint8Array => crate::host_fn::from_js_host_call(global, || {
Bun__allocUint8ArrayForCopy(global, len as usize, &mut ptr_out)
})?,
JSType::ArrayBuffer => crate::host_fn::from_js_host_call(global, || {
Bun__allocArrayBufferForCopy(global, len as usize, &mut ptr_out)
})?,
Expand Down
12 changes: 0 additions & 12 deletions src/jsc/bindings/ZigGlobalObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1622,18 +1622,6 @@ extern "C" JSC::EncodedJSValue Bun__createArrayBufferForCopy(JSC::JSGlobalObject
RELEASE_AND_RETURN(scope, JSValue::encode(JSC::JSArrayBuffer::create(globalObject->vm(), globalObject->arrayBufferStructure(JSC::ArrayBufferSharingMode::Default), WTF::move(arrayBuffer))));
}

extern "C" JSC::EncodedJSValue Bun__allocUint8ArrayForCopy(JSC::JSGlobalObject* globalObject, size_t len, void** ptr)
{
auto scope = DECLARE_THROW_SCOPE(globalObject->vm());

JSC::JSUint8Array* array = JSC::JSUint8Array::createUninitialized(globalObject, globalObject->m_typedArrayUint8.get(globalObject), len);
RETURN_IF_EXCEPTION(scope, {});

*ptr = array->vector();

return JSValue::encode(array);
}

extern "C" JSC::EncodedJSValue Bun__allocArrayBufferForCopy(JSC::JSGlobalObject* lexicalGlobalObject, size_t len, void** ptr)
{
auto& vm = JSC::getVM(lexicalGlobalObject);
Expand Down
6 changes: 0 additions & 6 deletions src/jsc/bindings/webcore/JSWebSocket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -939,12 +939,6 @@ WebSocket* JSWebSocket::toWrapped(JSC::VM&, JSC::JSValue value)
return nullptr;
}

// https://github.com/oven-sh/bun/issues/11866
JSC::JSValue getWebSocketConstructor(Zig::GlobalObject* globalObject)
{
return WebCore::JSWebSocket::getConstructor(globalObject->vm(), globalObject);
}

// Parses the `ws` module options shared by createWebSocket() and createWebSocketOverStream().
static void convertConnectedOptionsForWs(JSGlobalObject* lexicalGlobalObject, JSObject* object, WebSocketConnectedOptions& options)
{
Expand Down
1 change: 0 additions & 1 deletion src/jsc/bindings/webcore/JSWebSocket.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ template<> struct JSDOMWrapperConverterTraits<WebSocket> {
using ToWrappedReturnType = WebSocket*;
};

JSC::JSValue getWebSocketConstructor(Zig::GlobalObject* globalObject);
// Native binding for the built-in `ws` module:
// { createWebSocket, createWebSocketOverStream, sendFrame, setRef, detach, remoteAddress, feed, streamClosed }
JSC::JSValue createWebSocketBindingForWs(Zig::GlobalObject* globalObject);
Expand Down
2 changes: 0 additions & 2 deletions src/runtime/api/bun/subprocess.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,6 @@ pub(crate) mod js {
bun_jsc::codegen_cached_accessors!(
"Subprocess";
stdin,
stdout,
stderr,
terminal,
exitedPromise,
onExitCallback,
Expand Down
Loading