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
3 changes: 0 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 0 additions & 8 deletions scripts/docker.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -151,14 +151,6 @@ export const docker = {
return containers?.find(a => a.Id === containerId);
},

/**
* @returns {Promise<DockerContainer[]>}
*/
async listContainers() {
const containers = await this.spawn($`container ls --all`, { json: true });
return containers || [];
},

/**
* @typedef {Object} DockerRunOptions
* @property {string[]} [command]
Expand Down
11 changes: 0 additions & 11 deletions scripts/machine.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -254,17 +254,6 @@ const aws = {
return ImageId;
},

/**
* @param {Record<string, string | undefined>} options
* @returns {Promise<string>}
* @link https://awscli.amazonaws.com/v2/documentation/api/latest/reference/ec2/copy-image.html
*/
async copyImage(options) {
const flags = aws.getFlags(options);
const { ImageId } = await aws.spawn($`ec2 copy-image ${flags}`);
return ImageId;
},

/**
* @param {"image-available"} action
* @param {...string} imageIds
Expand Down
7 changes: 0 additions & 7 deletions scripts/tart.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,6 @@ export const tart = {
* @property {number} [Memory]
*/

/**
* @returns {Promise<TartVm[]>}
*/
async listVms() {
return this.spawn(["list"], { json: true });
},

/**
* @param {string} name
* @returns {Promise<TartVm | undefined>}
Expand Down
1 change: 0 additions & 1 deletion src/ast_jsc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,5 @@ path = "lib.rs"
workspace = true

[dependencies]
bun_core.workspace = true
bun_jsc.workspace = true
bun_ast.workspace = true
1 change: 0 additions & 1 deletion src/bundler_jsc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ workspace = true
[dependencies]
bun_opaque.workspace = true
bstr.workspace = true
bun_core.workspace = true
bun_bundler.workspace = true
bun_ast.workspace = true
bun_options_types.workspace = true
Expand Down
18 changes: 3 additions & 15 deletions src/codegen/bundle-functions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,14 @@
// single JSC::SourceProvider. Passing start/end positions to each function's
// JSC::SourceCode. JSC does this, but WebCore does not seem to as of writing.
import assert from "assert";
import { readdirSync, rmSync } from "fs";
import { readdirSync } from "fs";
import path from "path";
import { sliceSourceCode } from "./builtin-parser";
import { createAssertClientJS, createLogClientJS } from "./client-js";
import { getJS2NativeDTS } from "./generate-js2native";
import { cap, checkAscii, low, writeIfNotChanged } from "./helpers";
import { applyGlobalReplacements, define } from "./replacements";

const PARALLEL = false;
const KEEP_TMP = true;

if (import.meta.main) {
throw new Error("This script is not meant to be run directly");
}
Expand Down Expand Up @@ -388,13 +385,8 @@ export async function bundleBuiltinFunctions({ requireTransformer }: BundleBuilt
.filter(x => x.endsWith(".ts") && !x.endsWith(".d.ts"))
.sort();

// Bun seems to crash if this is parallelized, :(
if (PARALLEL) {
await Promise.all(filesToProcess.map(processFunctionFile));
} else {
for (const x of filesToProcess) {
await processFunctionFile(x);
}
for (const x of filesToProcess) {
await processFunctionFile(x);
}

let combinedSourceCode = "";
Expand Down Expand Up @@ -857,10 +849,6 @@ JSBuiltinInternalFunctions::JSBuiltinInternalFunctions(JSC::VM& vm) : m_vm(vm)
0,
);

if (!KEEP_TMP) {
await rmSync(TMP_DIR, { recursive: true });
}

globalThis.internalFunctionJSSize = totalJSSize;
globalThis.internalFunctionCount = files.reduce((acc, { functions }) => acc + functions.length, 0);
globalThis.internalFunctionFileCount = files.length;
Expand Down
1 change: 0 additions & 1 deletion src/codegen/bundle-modules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,6 @@ function layoutOrder(modules: string[], outputs: Map<string, string>): string[]
"node/https.ts",
"node/net.ts",
"node/url.ts",
"node/buffer.ts",
"node/tty.ts",
"node/worker_threads.ts",
"node/zlib.ts",
Expand Down
1 change: 0 additions & 1 deletion src/codegen/class-definitions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,6 @@ export class ClassDefinition {
*/
memoryCost?: boolean;
hasPendingActivity?: boolean;
isEventEmitter?: boolean;

configurable?: boolean;
enumerable?: boolean;
Expand Down
19 changes: 0 additions & 19 deletions src/codegen/cppbind.ts
Original file line number Diff line number Diff line change
Expand Up @@ -745,14 +745,6 @@ function generateRustFn(fn: CppFn, rustRaw: string[], rustWrap: string[]): void
);
}

function closest(node: SyntaxNode | null, type: string): SyntaxNode | null {
while (node) {
if (node.name === type) return node;
node = node.parent;
}
return null;
}

type CppParser = typeof cppParser;

async function processFile(parser: CppParser, file: string, allFunctions: CppFn[]) {
Expand Down Expand Up @@ -824,17 +816,6 @@ async function processFile(parser: CppParser, file: string, allFunctions: CppFn[

queryFoundLines.add(lineInfo.get(zigExportAttr.from).line);

// disabled because lezer parses (extern "C") separately to the function definition / block
/* const linkage = closest(fnNode, "LinkageSpecification");
const linkageString = linkage?.getChild("String");
if (!linkage || !linkageString || text(linkageString, ctx) !== '"C"') {
appendError(
nodePosition(fnNode, ctx),
'exported function must be extern "C":\n' +
(linkage ? prettyPrintLezerNode(linkage, ctx.sourceCode) : "no linkage"),
);
} */

const tagStr = text(tagIdentifier, ctx);
let tag: ExportTag | undefined;
if (
Expand Down
10 changes: 2 additions & 8 deletions src/js/internal/repl/node-inspect.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// Shim for Node's `internal/util/inspect` as consumed by the ported
// node:repl / internal/readline stack. getStringWidth/stripVTControlCharacters
// go straight to the native bindings so `require("node:readline")` does not
// pull in the 99 KB internal/util/inspect; inspect/format load it lazily on
// first access (REPL output / completion rendering).
// pull in the 99 KB internal/util/inspect; inspect loads it lazily on first
// access (REPL output / completion rendering).
Comment thread
robobun marked this conversation as resolved.
Resolved

const stripANSI = Bun.stripANSI;
const nativeStringWidth = $newCppFunction("stringWidth.cpp", "jsFunctionBunStringWidth", 1);
Expand Down Expand Up @@ -31,10 +31,4 @@ export default {
get inspect() {
return load().inspect;
},
get format() {
return load().format;
},
get formatWithOptions() {
return load().formatWithOptions;
},
};
Comment thread
claude[bot] marked this conversation as resolved.
Resolved
4 changes: 2 additions & 2 deletions src/jsc/VirtualMachine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3816,7 +3816,7 @@ impl VirtualMachine {
}

if self.hot_reload_deferred {
self.reload(None);
self.reload();
}
self.add_main_to_watcher_if_needed();
}
Expand Down Expand Up @@ -3878,7 +3878,7 @@ impl VirtualMachine {
}

/// Performs a hot reload: re-evaluates the entry point once any pending entry-point load settles.
pub(crate) fn reload(&mut self, _: Option<&mut crate::hot_reloader::HotReloadTask>) {
pub(crate) fn reload(&mut self) {
if self.hot_reload == HotReload::Watch {
// Watch reload replaces the process: never defer on a pending
// entry promise (node restarts regardless of child state), and
Expand Down
3 changes: 0 additions & 3 deletions src/jsc/bindings/ExceptionOr.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,6 @@ template<typename T> class [[nodiscard]] ExceptionOr {

private:
Expected<ReturnType, Exception> m_value;
#if ASSERT_ENABLED
bool m_wasReleased { false };
#endif
};

template<typename T> class ExceptionOr<T&> {
Expand Down
4 changes: 0 additions & 4 deletions src/jsc/bindings/SecretsLinux.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@ typedef void* gpointer;
typedef unsigned int guint;
typedef int gint;

// GLib constants
#define G_FALSE 0
#define G_TRUE 1

// Secret schema types
typedef enum {
SECRET_SCHEMA_NONE = 0,
Expand Down
8 changes: 0 additions & 8 deletions src/jsc/bindings/ZigGlobalObject.h
Original file line number Diff line number Diff line change
Expand Up @@ -644,8 +644,6 @@ class GlobalObject : public Bun::GlobalScope {
V(private, LazyPropertyOfGlobalObject<Structure>, m_importMetaBakeObjectStructure) \
V(private, LazyPropertyOfGlobalObject<Structure>, m_asyncBoundFunctionStructure) \
V(public, LazyPropertyOfGlobalObject<JSC::JSObject>, m_JSDOMFileConstructor) \
V(public, LazyPropertyOfGlobalObject<JSC::JSObject>, m_JSMIMEParamsConstructor) \
V(public, LazyPropertyOfGlobalObject<JSC::JSObject>, m_JSMIMETypeConstructor) \
\
V(private, LazyPropertyOfGlobalObject<Structure>, m_NapiExternalStructure) \
V(private, LazyPropertyOfGlobalObject<Structure>, m_NapiPrototypeStructure) \
Expand Down Expand Up @@ -723,10 +721,6 @@ class GlobalObject : public Bun::GlobalScope {
BunPlugin::OnLoad onLoadPlugins {};
BunPlugin::OnResolve onResolvePlugins {};

// This increases the cache hit rate for JSC::VM's SourceProvider cache
// It also avoids an extra allocation for the SourceProvider
// The key is a pointer to the source code
WTF::UncheckedKeyHashMap<uintptr_t, Ref<JSC::SourceProvider>> sourceProviderMap;
size_t reloadCount = 0;

void reload();
Expand Down Expand Up @@ -782,8 +776,6 @@ class GlobalObject : public Bun::GlobalScope {
bool hasOverriddenModuleResolveFilenameFunction = false;
// De-optimization once `require("module").wrapper` or `require("module").wrap` is written to
bool hasOverriddenModuleWrapper = false;
// De-optimization once `require("module").runMain` is written to
bool hasOverriddenModuleRunMain = false;

// node:crypto deprecation warnings are emitted at most once per realm, like Node, whose
// flags live in per-realm module state (lib/internal/crypto/keys.js). They must not be
Expand Down
1 change: 0 additions & 1 deletion src/jsc/bindings/napi.h
Original file line number Diff line number Diff line change
Expand Up @@ -824,7 +824,6 @@ class NapiRef {
const NapiEnv::BoundFinalizer* boundCleanup = nullptr;
void* nativeObject = nullptr;
uint32_t refCount = 0;
bool releaseOnWeaken = false;

private:
bool m_isEternal = false;
Expand Down
5 changes: 0 additions & 5 deletions src/jsc/bindings/ncrypto.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,8 @@ namespace ncrypto {

#if NCRYPTO_DEVELOPMENT_CHECKS
#define NCRYPTO_STR(x) #x
#define NCRYPTO_FAIL(MESSAGE) ASSERT_WITH_MESSAGE(false, MESSAGE)
#define NCRYPTO_ASSERT_EQUAL(LHS, RHS, MESSAGE) \
ASSERT_WITH_MESSAGE(LHS == RHS, MESSAGE)
#define NCRYPTO_ASSERT_TRUE(COND) ASSERT_WITH_MESSAGE(COND, NCRYPTO_STR(COND))
#else
#define NCRYPTO_FAIL(MESSAGE)
#define NCRYPTO_ASSERT_EQUAL(LHS, RHS, MESSAGE)
#define NCRYPTO_ASSERT_TRUE(COND)
#endif

Expand Down
6 changes: 0 additions & 6 deletions src/jsc/bindings/node/crypto/JSCipher.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,6 @@ enum class CipherKind {
Decipher,
};

enum class UpdateResult {
Success,
ErrorMessageSize,
ErrorState
};

enum class AuthTagState {
AuthTagUnknown,
AuthTagKnown,
Expand Down
1 change: 0 additions & 1 deletion src/jsc/bindings/webcore/BroadcastChannel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ WTF_MAKE_TZONE_ALLOCATED_IMPL(BroadcastChannel);
BroadcastChannel::BroadcastChannel(ScriptExecutionContext& context, const String& name)
: ActiveDOMObject(&context)
, m_name(name.isolatedCopy())
, m_contextId(context.identifier())
{
EventTarget::initializeWeakPtrFactory();
BunBroadcastChannelRegistry::singleton().subscribe(m_name, context, *this);
Expand Down
1 change: 0 additions & 1 deletion src/jsc/bindings/webcore/BroadcastChannel.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ class BroadcastChannel final : public ThreadSafeRefCountedAndCanMakeThreadSafeWe
};

const String m_name;
const ScriptExecutionContextIdentifier m_contextId;

std::atomic<uint64_t> m_state { 0 };

Expand Down
Loading
Loading