Skip to content
Merged
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
22 changes: 0 additions & 22 deletions src/bun_core/string/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -754,15 +754,6 @@ impl String {
bytes.len() == lit.len() && strings::eql_comptime_ignore_len(bytes, lit)
}

/// `bun.String.githubAction` — returns a `Display`
/// formatter that escapes the string for GitHub Actions annotation output
/// (`%0A` for newlines, ANSI stripped). Encoding-aware: materialises a
/// UTF-8 view inside `fmt` so 16-bit / WTF-backed strings are handled.
#[inline]
pub fn github_action(&self) -> StringGithubActionFormatter<'_> {
StringGithubActionFormatter { text: self }
}

/// `bun.String.hasPrefixComptime` — ASCII prefix check. Dispatches on
/// encoding so only `prefix.len()` units are touched; never scans or
/// transcodes `self`.
Expand Down Expand Up @@ -1266,19 +1257,6 @@ impl core::fmt::Display for String {
}
}

/// `Display` adapter for [`String::github_action`]. Converts to UTF-8 on the
/// fly (handles 16-bit / WTF-backed strings) and delegates to
/// `crate::fmt::github_action_writer`.
pub struct StringGithubActionFormatter<'a> {
text: &'a String,
}
impl core::fmt::Display for StringGithubActionFormatter<'_> {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
let utf8 = self.text.to_utf8_without_ref();
crate::fmt::github_action_writer(f, utf8.slice())
}
}

/// `Display` adapter for [`ZigString::github_action`]. Converts to UTF-8 on
/// the fly (handles 16-bit / latin-1 encodings) and delegates to
/// `crate::fmt::github_action_writer`.
Expand Down
7 changes: 0 additions & 7 deletions src/jsc/Errorable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,6 @@ impl<T: Copy> Errorable<T> {
}
}

pub fn value(val: T) -> Self {
Self {
result: Result { value: val },
success: true,
}
}

pub fn ok(val: T) -> Self {
Self {
result: Result { value: val },
Expand Down
13 changes: 0 additions & 13 deletions src/jsc/JSUint8Array.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use core::ffi::c_void;

use crate::sizes;
use crate::{JSGlobalObject, JSValue};

bun_opaque::opaque_ffi! {
Expand All @@ -9,18 +8,6 @@ bun_opaque::opaque_ffi! {
}

impl JSUint8Array {
pub fn ptr(&self) -> *mut u8 {
// SAFETY: `self` points at a live JSUint8Array cell; the typed-array vector
// pointer lives at a fixed byte offset computed by the C++ codegen
// (`crate::sizes`). `byte_add` preserves pointer provenance.
unsafe {
std::ptr::from_ref::<Self>(self)
.byte_add(sizes::BUN_FFI_POINTER_OFFSET_TO_TYPED_ARRAY_VECTOR)
.cast::<*mut u8>()
.read()
}
}

/// `bytes` must come from `bun.default_allocator` (the global mimalloc allocator);
/// ownership is transferred to the returned JS Uint8Array.
// The global allocator IS mimalloc, so `Box<[u8]>` encodes that ownership.
Expand Down
9 changes: 0 additions & 9 deletions src/jsc/RefString.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,8 @@
use core::ffi::c_void;
use core::ptr::NonNull;

use bun_jsc::{JSGlobalObject, JSValue, JsResult};
// `bun_core::WTFStringImpl` is the *pointer* type (= `*mut WTFStringImplStruct`).
use bun_core::WTFStringImpl;
use bun_jsc::StringJsc as _; // extension trait providing `.to_js()` on `bun_core::String`

pub(crate) type Hash = u32;

Expand All @@ -36,13 +34,6 @@ pub struct RefString {
}

impl RefString {
pub fn to_js(&self, global: &JSGlobalObject) -> JsResult<JSValue> {
// Wrap the raw
// `WTFStringImpl` pointer without bumping the refcount (`String` has
// no `Drop`, so this is adopt-then-forget).
bun_core::String::adopt_wtf_impl(self.impl_).to_js(global)
}

pub(crate) fn compute_hash(input: &[u8]) -> u32 {
bun_hash::XxHash32::hash(0, input)
}
Expand Down
5 changes: 0 additions & 5 deletions src/jsc/bindings/BunClientData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,6 @@ void JSVMClientData::JSHeapDataDeleter::operator()(JSHeapData* heapData) const

JSVMClientData::~JSVMClientData()
{
m_clients.forEach([](auto& client) {
client.willDestroyVM();
});
m_clients.clear();

m_normalWorld = nullptr;
}
void JSVMClientData::create(VM* vm, void* bunVM)
Expand Down
5 changes: 0 additions & 5 deletions src/jsc/bindings/BunClientData.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@ class DOMWrapperWorld;
// #include "WorkerThreadType.h"
#include <wtf/Function.h>
#include <wtf/HashSet.h>
#include <wtf/WeakHashSet.h>
#include <wtf/RefPtr.h>
#include "JSVMClientDataClient.h"
#include <JavaScriptCore/WeakInlines.h>
#include <wtf/StdLibExtras.h>
#include "JSCTaskScheduler.h"
Expand Down Expand Up @@ -151,8 +149,6 @@ class JSVMClientData : public JSC::VM::ClientData {
// after every swap.
WTF::UncheckedKeyHashMap<WTF::String, RefPtr<JSC::SourceProvider>> isolationSourceProviderCache;

void addClient(JSVMClientDataClient& client) { m_clients.add(client); }

private:
bool isWebCoreJSClientData() const final { return true; }

Expand Down Expand Up @@ -185,7 +181,6 @@ class JSVMClientData : public JSC::VM::ClientData {
Vector<JSC::IsoSubspace*> m_outputConstraintSpaces;

WebCore::HTTPHeaderIdentifiers m_httpHeaderIdentifiers;
WeakHashSet<JSVMClientDataClient> m_clients;
};

} // namespace WebCore
Expand Down
12 changes: 0 additions & 12 deletions src/jsc/bindings/IDLTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -365,18 +365,6 @@ struct IDLDate : IDLType<WallTime> {
static WallTime extractValueFromNullable(WallTime value) { return value; }
};

struct IDLJSON : IDLType<String> {
using ConversionResultType = String;
using NullableConversionResultType = String;
using ParameterType = const String&;
using NullableParameterType = const String&;

using NullableType = String;
static String nullValue() { return String(); }
static bool isNullValue(const String& value) { return value.isNull(); }
template<typename U> static U&& extractValueFromNullable(U&& value) { return std::forward<U>(value); }
};

struct IDLScheduledAction : IDLType<std::unique_ptr<ScheduledAction>> {
};
template<typename T> struct IDLSerializedScriptValue : IDLWrapper<T> {
Expand Down
8 changes: 0 additions & 8 deletions src/jsc/bindings/JSDOMWrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,6 @@ inline constexpr uint8_t JSDOMWrapperType = 0b11101110;
inline constexpr uint8_t JSEventType = 0b11101111;
inline constexpr uint8_t JSNodeType = 0b11110000;
inline constexpr uint8_t JSNodeTypeMask = 0b00001111;
inline constexpr uint8_t JSTextNodeType = JSNodeType | NodeConstants::TEXT_NODE;
inline constexpr uint8_t JSProcessingInstructionNodeType = JSNodeType | NodeConstants::PROCESSING_INSTRUCTION_NODE;
inline constexpr uint8_t JSDocumentTypeNodeType = JSNodeType | NodeConstants::DOCUMENT_TYPE_NODE;
inline constexpr uint8_t JSDocumentFragmentNodeType = JSNodeType | NodeConstants::DOCUMENT_FRAGMENT_NODE;
inline constexpr uint8_t JSDocumentWrapperType = JSNodeType | NodeConstants::DOCUMENT_NODE;
inline constexpr uint8_t JSCommentNodeType = JSNodeType | NodeConstants::COMMENT_NODE;
inline constexpr uint8_t JSCDATASectionNodeType = JSNodeType | NodeConstants::CDATA_SECTION_NODE;
inline constexpr uint8_t JSAttrNodeType = JSNodeType | NodeConstants::ATTRIBUTE_NODE;
inline constexpr uint8_t JSElementType = 0b11110000 | NodeConstants::ELEMENT_NODE;
inline constexpr uint8_t JSAsJSONType = JSElementType;

Expand Down
13 changes: 0 additions & 13 deletions src/jsc/bindings/JSVMClientDataClient.h

This file was deleted.

42 changes: 0 additions & 42 deletions src/jsc/bindings/ares_build.h

This file was deleted.

Loading
Loading