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
4 changes: 0 additions & 4 deletions scripts/build/flags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -699,16 +699,12 @@ export const defines: Flag[] = [
"_HAS_EXCEPTIONS=0",
"LIBUS_USE_OPENSSL=1",
"LIBUS_USE_BORINGSSL=1",
"WITH_BORINGSSL=1",
"STATICALLY_LINKED_WITH_JavaScriptCore=1",
"STATICALLY_LINKED_WITH_BMALLOC=1",
"BUILDING_WITH_CMAKE=1",
"JSC_OBJC_API_ENABLED=0",
"BUN_SINGLE_THREADED_PER_VM_ENTRY_SCOPE=1",
"NAPI_EXPERIMENTAL=ON",
"NODE_API_EXPERIMENTAL_NOGC_ENV_OPT_OUT=1",
"NOMINMAX",
"IS_BUILD",
"BUILDING_JSCONLY__",
],
desc: "Core bun defines (always on)",
Expand Down
2 changes: 0 additions & 2 deletions src/dns/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,6 @@ pub enum Family {
Unspecified,
Inet,
Inet6,
Unix,
}

bun_core::comptime_string_map! {
Expand All @@ -194,7 +193,6 @@ impl Family {
Family::Unspecified => 0,
Family::Inet => sock::AF_INET,
Family::Inet6 => sock::AF_INET6,
Family::Unix => sock::AF_UNIX,
}
}
}
Expand Down
9 changes: 0 additions & 9 deletions src/event_loop/EventLoopTimer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,6 @@ impl EventLoopTimer {
#[repr(u8)]
#[derive(Copy, Clone, Eq, PartialEq, strum::IntoStaticStr)]
pub enum Tag {
TimerCallback,
TimeoutObject,
ImmediateObject,
StatWatcherScheduler,
Expand Down Expand Up @@ -221,12 +220,6 @@ impl Tag {
}
}

pub struct TimerCallback {
pub callback: fn(*mut TimerCallback),
// Opaque user ctx; ownership stays with whoever installs the callback.
pub event_loop_timer: EventLoopTimer,
}

/// Stamp out one `unsafe fn $method(*const EventLoopTimer) -> *mut Self` per
/// `(method => field)` pair: each recovers the embedding owner from a pointer
/// to the named intrusive [`EventLoopTimer`] slot (typed container_of).
Expand Down Expand Up @@ -267,8 +260,6 @@ macro_rules! impl_timer_owner {
};
}

crate::impl_timer_owner!(TimerCallback; from_timer_ptr => event_loop_timer);

#[repr(u8)]
#[derive(Copy, Clone, Eq, PartialEq, Default)]
pub enum State {
Expand Down
15 changes: 0 additions & 15 deletions src/install/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,12 @@ pub enum Error {
NotDir,
#[error("NameTooLong")]
NameTooLong,
#[error("FileTooBig")]
FileTooBig,
#[error("SymLinkLoop")]
SymLinkLoop,
#[error("ProcessFdQuotaExceeded")]
ProcessFdQuotaExceeded,
#[error("SystemFdQuotaExceeded")]
SystemFdQuotaExceeded,
#[error("SystemResources")]
SystemResources,
#[error("ReadOnlyFileSystem")]
ReadOnlyFileSystem,
#[error("FileSystem")]
FileSystem,
#[error("FileBusy")]
FileBusy,
#[error("DeviceBusy")]
DeviceBusy,
#[error("TarballHTTP400")]
Expand Down Expand Up @@ -271,14 +261,9 @@ impl Error {
Self::AccessDenied => "AccessDenied",
Self::NotDir => "NotDir",
Self::NameTooLong => "NameTooLong",
Self::FileTooBig => "FileTooBig",
Self::SymLinkLoop => "SymLinkLoop",
Self::ProcessFdQuotaExceeded => "ProcessFdQuotaExceeded",
Self::SystemFdQuotaExceeded => "SystemFdQuotaExceeded",
Self::SystemResources => "SystemResources",
Self::ReadOnlyFileSystem => "ReadOnlyFileSystem",
Self::FileSystem => "FileSystem",
Self::FileBusy => "FileBusy",
Self::DeviceBusy => "DeviceBusy",
Self::TarballHTTP400 => "TarballHTTP400",
Self::TarballHTTP401 => "TarballHTTP401",
Expand Down
2 changes: 0 additions & 2 deletions src/install/hosted_git_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,6 @@ pub enum Representation {
Shortcut,
/// git+ssh://git@domain/user/project.git#committish
Sshurl,
/// ssh://domain/user/project.git#committish
Ssh,
/// https://domain/user/project.git#committish
Https,
/// git://domain/user/project.git#committish
Expand Down
8 changes: 0 additions & 8 deletions src/install/lockfile/bun.lock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2344,14 +2344,6 @@ pub(crate) fn parse_into_binary_lockfile(
);
return Err(ParseError::UnexpectedResolution);
}
Err(crate::resolution::FromTextLockfileError::InvalidSemver) => {
log.add_error_fmt(
source,
item_loc(source, key_loc, res_info_idx),
format_args!("Invalid package version: {}", bstr::BStr::new(res_str)),
);
return Err(ParseError::InvalidSemver);
}
};

let mut npm_url_needs_integrity = false;
Expand Down
2 changes: 0 additions & 2 deletions src/install/migration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,6 @@ pub fn detect_and_load_other_lockfile<'a>(
| MigratePnpmLockfileError::PnpmLockfileInvalidSnapshot
| MigratePnpmLockfileError::PnpmLockfileInvalidDependency
| MigratePnpmLockfileError::PnpmLockfileMissingDependencyVersion
| MigratePnpmLockfileError::PnpmLockfileInvalidOverride
| MigratePnpmLockfileError::PnpmLockfileInvalidPatchedDependency
| MigratePnpmLockfileError::PnpmLockfileMissingCatalogEntry
| MigratePnpmLockfileError::PnpmLockfileUnresolvableDependency => {
// These errors are continuable - log the error but don't exit
Expand Down
4 changes: 0 additions & 4 deletions src/install/pnpm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,6 @@ pub enum MigratePnpmLockfileError {
PnpmLockfileMissingDependencyVersion,
#[error("PnpmLockfileInvalidDependency")]
PnpmLockfileInvalidDependency,
#[error("PnpmLockfileInvalidOverride")]
PnpmLockfileInvalidOverride,
#[error("PnpmLockfileInvalidPatchedDependency")]
PnpmLockfileInvalidPatchedDependency,
#[error("PnpmLockfileMissingCatalogEntry")]
PnpmLockfileMissingCatalogEntry,
#[error("PnpmLockfileUnresolvableDependency")]
Expand Down
2 changes: 0 additions & 2 deletions src/install/resolution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1002,8 +1002,6 @@ pub enum FromTextLockfileError {
OutOfMemory,
#[error("unexpected resolution")]
UnexpectedResolution,
#[error("invalid semver")]
InvalidSemver,
}

bun_core::oom_from_alloc!(FromTextLockfileError);
Expand Down
2 changes: 0 additions & 2 deletions src/install/windows-shim/bun_shim_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,6 @@ pub enum FailReason {
NoDirname,
CouldNotOpenShim,
CouldNotReadShim,
InvalidShimDataSize,
ShimNotFound,
CreateProcessFailed,
/// When encountering this outside of standalone mode, you should fallback
Expand All @@ -239,7 +238,6 @@ impl FailReason {
FailReason::ShimNotFound => "could not find bin metadata file",
FailReason::CouldNotOpenShim => "could not open bin metadata file",
FailReason::CouldNotReadShim => "could not read bin metadata",
FailReason::InvalidShimDataSize => "bin metadata is corrupt (size)",
FailReason::InvalidShimValidation => "bin metadata is corrupt (validate)",
FailReason::InvalidShimBounds => "bin metadata is corrupt (bounds)",
// The difference between these two is that one is with a shebang (#!/usr/bin/env node) and
Expand Down
1 change: 0 additions & 1 deletion src/js/internal/fixed_queue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,5 @@ class FixedQueue<T> {
}

export default {
FixedCircularBuffer,
FixedQueue,
};
2 changes: 0 additions & 2 deletions src/js/internal/http1_server_fallback.ts
Original file line number Diff line number Diff line change
Expand Up @@ -469,10 +469,8 @@ function closeAllHttp1Connections(server) {
}

export default {
createHttp1FallbackResponseHandle,
connectionListenerHTTP1,
closeIdleHttp1Connections,
closeAllHttp1Connections,
kHttp1Connections,
kHttp1ActiveRequests,
};
1 change: 0 additions & 1 deletion src/js/internal/inspector/cdp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -698,5 +698,4 @@ class InspectorCDPAdapter {

export default {
InspectorCDPAdapter,
EXECUTION_CONTEXT_ID,
};
1 change: 0 additions & 1 deletion src/js/internal/promisify.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ promisify.custom = kCustomPromisifiedSymbol;
}

export default {
defineCustomPromisify,
defineCustomPromisifyArgs,
promisify,
};
23 changes: 0 additions & 23 deletions src/js/internal/repl/node-shims.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ const {

// ---- internal/util ----------------------------------------------------

const { kEmptyObject } = require("internal/shared");

// Node's real implementation reconstructs the regex in an internal realm so a
// tampered `RegExp.prototype[Symbol.replace]` can't observe it. Bun has no
// internal realm; the load-time-captured intrinsics close the `[Symbol.*]`
Expand Down Expand Up @@ -111,16 +109,6 @@ function has() {
return true;
}

// ---- internal/streams/utils ----------------------------------------------

function isWritable(stream) {
return typeof stream?.write === "function";
}

// ---- internal/events/abort_listener ----------------------------------------------

const { addAbortListener } = require("internal/abort_listener");

// ---- internal/bootstrap/realm ----------------------------------------------

const BuiltinModule = {
Expand Down Expand Up @@ -271,10 +259,6 @@ function makeContextifyScript(
});
}

function runScriptInThisContext(script, displayErrors, _breakOnFirstLine) {
return script.runInThisContext({ displayErrors });
}

// ---- internal/modules/cjs/loader (constructible Module shim) ----------------

class CJSModuleShim {
Expand Down Expand Up @@ -419,8 +403,6 @@ export default {
decorateErrorStack,
deprecate: util.deprecate,
isError,
kEmptyObject,
promisify: util.promisify,
// internal/util/colors
shouldColorize,
// internal/util/debuglog
Expand All @@ -434,10 +416,6 @@ export default {
// internal/process/permission (consumed as a namespace: permission.isEnabled())
isEnabled,
has,
// internal/streams/utils
isWritable,
// internal/events/abort_listener
addAbortListener,
// internal/bootstrap/realm
BuiltinModule,
// internal/modules/esm/get_format
Expand All @@ -452,5 +430,4 @@ export default {
makeRequireFunction,
// internal/vm
makeContextifyScript,
runScriptInThisContext,
};
1 change: 0 additions & 1 deletion src/js/internal/sql/query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,6 @@ export default {
Query,
SQLQueryFlags,
SQLQueryResultMode,
SQLQueryStatus,

symbols: {
_resolve,
Expand Down
3 changes: 0 additions & 3 deletions src/js/internal/sql/shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2141,11 +2141,8 @@ export interface DatabaseAdapter<Connection, ConnectionHandle, QueryHandle> {
}

export default {
parseDefinitelySqliteUrl,
parseOptions,
SQLHelper,
buildDefinedColumnsAndQuery,
normalizeSSLMode,
SQLResultArray,
SQLArrayParameter,
getHelperCommandFromDetect,
Expand Down
4 changes: 0 additions & 4 deletions src/js/internal/sql/sqlite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -568,8 +568,4 @@ class SQLiteAdapter implements DatabaseAdapter<BunSQLiteModule.Database, BunSQLi

export default {
SQLiteAdapter,
SQLCommand,
commandToString,
parseSQLQuery,
SQLiteQueryHandle,
};
4 changes: 0 additions & 4 deletions src/js/internal/streams/iter/from.ts
Original file line number Diff line number Diff line change
Expand Up @@ -567,9 +567,5 @@ export default {
isPrimitiveChunk,
isSyncIterable,
isUint8ArrayBatch,
normalizeAsyncSource,
normalizeAsyncValue,
normalizeSyncSource,
normalizeSyncValue,
primitiveToUint8Array,
};
1 change: 0 additions & 1 deletion src/js/internal/streams/iter/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,6 @@ export default {
kMultiConsumerDefaultHWM,
kPushDefaultHWM,
kResolvedPromise,
allUint8Array,
clampHWM,
concatBytes,
convertChunks,
Expand Down
1 change: 0 additions & 1 deletion src/js/internal/trace_events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -843,7 +843,6 @@ export default {
trace,
initFromCli,
setFilePattern,
setTid,
emitWorkerThreadName,
inspectorStart,
inspectorStop,
Expand Down
2 changes: 0 additions & 2 deletions src/jsc/bindings/BunObject.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

namespace Bun {

JSC_DECLARE_HOST_FUNCTION(functionBunPeek);
JSC_DECLARE_HOST_FUNCTION(functionBunPeekStatus);
JSC_DECLARE_HOST_FUNCTION(functionBunSleep);
JSC_DECLARE_HOST_FUNCTION(functionBunDeepEquals);
JSC_DECLARE_HOST_FUNCTION(functionBunDeepMatch);
Expand Down
18 changes: 0 additions & 18 deletions src/jsc/bindings/BunProcess.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2053,24 +2053,6 @@ JSValue Process::emitWarning(JSC::JSGlobalObject* lexicalGlobalObject, JSValue w
if (!code.isUndefined()) errorInstance->putDirect(vm, builtinNames(vm).codePublicName(), code, JSC::PropertyAttribute::DontEnum | 0);
if (!detail.isUndefined()) errorInstance->putDirect(vm, vm.propertyNames->detail, detail, JSC::PropertyAttribute::DontEnum | 0);

/*
// TODO: ErrorCaptureStackTrace(warning, ctor || process.emitWarning);
// This doesn't work, getStackTrace does not get any stack frames.
Vector<StackFrame> stackTrace;
const size_t framesToSkip = 1;
JSValue caller;
if (ctor.toBoolean(globalObject)) {
caller = ctor;
} else {
auto* globalObject = uncheckedDowncast<Zig::GlobalObject>(lexicalGlobalObject);
auto* process = globalObject->processObject();
caller = process->get(globalObject, Identifier::fromString(vm, String("emitWarning"_s)));
RETURN_IF_EXCEPTION(scope, {});
}
vm.interpreter.getStackTrace(errorInstance, stackTrace, framesToSkip, globalObject->stackTraceLimit().value_or(0), caller.isCallable() ? caller.asCell() : nullptr);
errorInstance->putDirect(vm, vm.propertyNames->stack, jsString(vm, Interpreter::stackTraceAsString(vm, stackTrace)), static_cast<unsigned>(PropertyAttribute::DontEnum));
*/

RELEASE_AND_RETURN(scope, emitWarningErrorInstance(lexicalGlobalObject, errorInstance));
}

Expand Down
21 changes: 0 additions & 21 deletions src/jsc/bindings/BunString.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -559,27 +559,6 @@ extern "C" JSC::EncodedJSValue BunString__createArray(
return JSValue::encode(array);
}

extern "C" [[ZIG_EXPORT(nothrow)]] void BunString__toWTFString(BunString* bunString)
{
WTF::String str;
if (bunString->tag == BunStringTag::ZigString) {
if (Zig::isTaggedExternalPtr(bunString->impl.zig.ptr)) {
str = Zig::toString(bunString->impl.zig);
} else {
str = Zig::toStringCopy(bunString->impl.zig);
}

} else if (bunString->tag == BunStringTag::StaticZigString) {
str = Zig::toStringStatic(bunString->impl.zig);
} else {
return;
}

auto impl = str.releaseImpl();
bunString->impl.wtf = impl.leakRef();
bunString->tag = BunStringTag::WTFStringImpl;
}

extern "C" BunString URL__getFileURLString(BunString* filePath)
{
return Bun::toStringRef(WTF::URL::fileURLWithFileSystemPath(filePath->toWTFString()).stringWithoutFragmentIdentifier());
Expand Down
1 change: 1 addition & 0 deletions src/jsc/bindings/ErrorStackTrace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -723,6 +723,7 @@ String functionName(JSC::VM& vm, JSC::JSGlobalObject* lexicalGlobalObject, const
}
}

// Weak-referenced by JSC::ErrorInstance::finalizeUnconditionally in vendor/WebKit.
extern "C" void Bun__errorInstance__finalize(void* bunErrorData)
{
UNUSED_PARAM(bunErrorData);
Expand Down
Loading