Remove dead code from webcore C++, highway_strings, inspector agents, InlineBlob, Ipc.ts - #36791
Conversation
… InlineBlob, Ipc.ts C++ bindings: - Delete TextCodecASCIIFastPath.h (78 lines, never #included) - Delete webcore/Node.h (108 lines, WebCore::Node never instantiated or subclassed) and its two #include sites - Delete stub headers JSDOMWindow.h, JSServiceWorker.h, JSWindowProxy.h and their #include sites - highway_strings.cpp: remove ScanCharFrequencyImpl, HWY_EXPORT, and highway_char_frequency (no Rust caller since #35002) - TextCodecWrapper.cpp: remove Bun__isEncodingSupported and Bun__getCanonicalEncodingName (no Rust caller since #35002) - StrongRef: remove Bun__StrongRef__get, Bun__StrongRef__clear, StrongRootBlock::clearValue (Rust reads the slot directly) - InspectorLifecycleAgent: remove Bun__LifecycleAgentReportReload wrapper and reportReload() method (no Rust caller) - InspectorBunFrontendDevServerAgent: remove notifyClientErrorReported/notifyGraphUpdate wrappers, their class methods, and the stale mismatched-prefix extern block in the header - JSS3File.cpp: remove file-scope static customHasInstance (never wired to a method table; StructureFlags has no ImplementsHasInstance) C++ commented-out code (>6 months stale per git blame): - JSTextEncoder.cpp: disabled DOMJIT declarations, signatures, hash-table entries and JSC_DEFINE_JIT_OPERATION bodies - JSURLSearchParams/JSErrorEvent/JSDOMException: BINDING_INTEGRITY vtable-check scaffolding - JSPerformance/JSDOMURL/JSWorkerOptions: JSDOMWindowBase-gated property-deletion paths - JSEventListener: beforeunload return-value handling (helper definition and call site) - PerformanceUserTiming: restrictedMarkFunctions lookup in convertMarkToTimestamp Rust: - Blob.rs: remove struct Inline and its impls (every reference in Body.rs/RequestContext.rs is commented out; Any enum has no Inline variant) - Body.rs, RequestContext.rs: remove the commented-out InlineBlob match arms that referenced it - S3File.rs: remove has_instance and the JSS3File__hasInstance export (its only C++ caller is the removed customHasInstance) - streams.rs: remove BufferAction::get (zero callers) - FileReader.rs: remove unused TAG const src/js (>6 months stale per git blame): - builtins/Ipc.ts: remove 131-line commented-out handleConversion map - internal/fs/streams.ts: remove commented-out fastPath._getFd block - node/worker_threads.ts: remove commented-out type imports Verified: rg across src/ and build/debug/codegen/ shows zero remaining references for every removed symbol; bun bd and rust:check-all (all targets) pass.
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
WalkthroughThis cleanup removes obsolete native APIs, runtime types, commented-out implementations, unused includes, and deleted headers. It also adds source-lint checks that prevent removed symbols and code blocks from returning. ChangesObsolete code and symbol cleanup
Possibly related PRs
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@test/internal/source-lints/dead-symbols-webcore-inline-extern.test.ts`:
- Line 51: Update the JSDOMURL.cpp regex entry in the dead-symbol lint test to
match only the known commented-out createObjectURL/DeletePropertyMode block,
anchoring it to the expected commented lines or reproducing the exact removed
block. Do not use a broad pattern that begins at arbitrary comments or spans
unrelated content.
- Around line 15-25: Update the deleted-header check in the “deleted
webcore/bindings header files do not reappear” test to determine whether each
path exists in Git’s tracked tree via git ls-tree, rather than using the
working-tree exists helper. Preserve the deleted list and empty-result
assertion, and adapt the filtering logic to the Git-state lookup.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 083425f0-8aaf-4156-8b24-7a0de5748baf
📒 Files selected for processing (39)
src/js/builtins/Ipc.tssrc/js/internal/fs/streams.tssrc/js/node/worker_threads.tssrc/jsc/bindings/InspectorBunFrontendDevServerAgent.cppsrc/jsc/bindings/InspectorBunFrontendDevServerAgent.hsrc/jsc/bindings/InspectorLifecycleAgent.cppsrc/jsc/bindings/InspectorLifecycleAgent.hsrc/jsc/bindings/JSS3File.cppsrc/jsc/bindings/StrongRef.cppsrc/jsc/bindings/StrongRef.hsrc/jsc/bindings/StrongRootBlock.hsrc/jsc/bindings/TextCodecASCIIFastPath.hsrc/jsc/bindings/TextCodecWrapper.cppsrc/jsc/bindings/WebCoreOpaqueRoot.hsrc/jsc/bindings/highway_strings.cppsrc/jsc/bindings/webcore/EventTargetHeaders.hsrc/jsc/bindings/webcore/JSDOMException.cppsrc/jsc/bindings/webcore/JSDOMURL.cppsrc/jsc/bindings/webcore/JSDOMWindow.hsrc/jsc/bindings/webcore/JSErrorEvent.cppsrc/jsc/bindings/webcore/JSEventListener.cppsrc/jsc/bindings/webcore/JSEventTargetCustom.cppsrc/jsc/bindings/webcore/JSMessageEvent.cppsrc/jsc/bindings/webcore/JSMessageEventCustom.cppsrc/jsc/bindings/webcore/JSPerformance.cppsrc/jsc/bindings/webcore/JSServiceWorker.hsrc/jsc/bindings/webcore/JSTextEncoder.cppsrc/jsc/bindings/webcore/JSURLSearchParams.cppsrc/jsc/bindings/webcore/JSWindowProxy.hsrc/jsc/bindings/webcore/JSWorkerOptions.cppsrc/jsc/bindings/webcore/Node.hsrc/jsc/bindings/webcore/PerformanceUserTiming.cppsrc/runtime/server/RequestContext.rssrc/runtime/webcore/Blob.rssrc/runtime/webcore/Body.rssrc/runtime/webcore/FileReader.rssrc/runtime/webcore/S3File.rssrc/runtime/webcore/streams.rstest/internal/source-lints/dead-symbols-webcore-inline-extern.test.ts
💤 Files with no reviewable changes (37)
- src/jsc/bindings/WebCoreOpaqueRoot.h
- src/jsc/bindings/webcore/JSDOMException.cpp
- src/jsc/bindings/webcore/JSEventTargetCustom.cpp
- src/jsc/bindings/webcore/JSServiceWorker.h
- src/runtime/webcore/streams.rs
- src/jsc/bindings/webcore/JSTextEncoder.cpp
- src/jsc/bindings/webcore/JSDOMWindow.h
- src/jsc/bindings/webcore/JSMessageEvent.cpp
- src/jsc/bindings/StrongRootBlock.h
- src/js/node/worker_threads.ts
- src/jsc/bindings/StrongRef.cpp
- src/jsc/bindings/webcore/JSDOMURL.cpp
- src/jsc/bindings/webcore/JSEventListener.cpp
- src/jsc/bindings/webcore/JSWorkerOptions.cpp
- src/jsc/bindings/StrongRef.h
- src/jsc/bindings/InspectorLifecycleAgent.h
- src/jsc/bindings/webcore/PerformanceUserTiming.cpp
- src/jsc/bindings/webcore/JSMessageEventCustom.cpp
- src/jsc/bindings/webcore/JSURLSearchParams.cpp
- src/jsc/bindings/webcore/JSWindowProxy.h
- src/js/builtins/Ipc.ts
- src/jsc/bindings/webcore/JSPerformance.cpp
- src/runtime/webcore/FileReader.rs
- src/jsc/bindings/webcore/Node.h
- src/jsc/bindings/TextCodecWrapper.cpp
- src/jsc/bindings/TextCodecASCIIFastPath.h
- src/jsc/bindings/JSS3File.cpp
- src/jsc/bindings/webcore/EventTargetHeaders.h
- src/jsc/bindings/webcore/JSErrorEvent.cpp
- src/js/internal/fs/streams.ts
- src/jsc/bindings/InspectorBunFrontendDevServerAgent.h
- src/jsc/bindings/InspectorBunFrontendDevServerAgent.cpp
- src/runtime/server/RequestContext.rs
- src/jsc/bindings/InspectorLifecycleAgent.cpp
- src/runtime/webcore/S3File.rs
- src/jsc/bindings/highway_strings.cpp
- src/runtime/webcore/Blob.rs
Replace the /s-flagged multi-line pattern with a single-token anchor (JSDedicatedWorkerGlobalScope) that appeared only in the removed block, so an unrelated // comment elsewhere in the file can never match.
The verification harness's stash-based src/ revert does not reliably re-delete whole files (same limitation noted on the MessagePortChannel*.h stubs), so asserting worktree absence with existsSync fails the with-fix run. Check the #include lines in surviving files instead, which the harness applies as ordinary content edits.
…, JSTextEncoder PerformanceUserTiming: the restrictedMarkFunctions map, NavigationTimingFunction typedef, and isRestrictedMarkName() had zero callers (the only consumer was the commented-out convertMarkToTimestamp block already removed). Drops the now-unused PerformanceTiming.h and SortedArrayMap.h includes with them. StrongRootBlock: read(unsigned) was only called from Bun__StrongRef__get (removed earlier); same cascade as clearValue(). JSTextEncoder: the DOMJIT*/DFGAbstractHeap includes and using-directive existed only for the commented-out JSC_DEFINE_JIT_OPERATION bodies.
|
Updated 11:14 AM PT - Aug 2nd, 2026
❌ @robobun, your commit e434f18 has 2 failures in
🧪 To try this PR locally: bunx bun-pr 36791That installs a local version of the PR into your bun-36791 --bun |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@test/internal/source-lints/dead-symbols-webcore-inline-extern.test.ts`:
- Line 25: Update the regex entry for JSEventTargetCustom.cpp in the dead-symbol
guard to match an actual preprocessor include directive for JSDOMWindow.h or
JSWindowProxy.h, rather than matching those names anywhere in the file. Keep the
pattern narrowly scoped and consistent with the exact include-line matching used
by the neighboring entries.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 644f494e-f938-4b43-a81c-c832064d1042
📒 Files selected for processing (5)
src/jsc/bindings/StrongRootBlock.hsrc/jsc/bindings/webcore/JSTextEncoder.cppsrc/jsc/bindings/webcore/PerformanceUserTiming.cppsrc/jsc/bindings/webcore/PerformanceUserTiming.htest/internal/source-lints/dead-symbols-webcore-inline-extern.test.ts
💤 Files with no reviewable changes (4)
- src/jsc/bindings/webcore/PerformanceUserTiming.h
- src/jsc/bindings/webcore/JSTextEncoder.cpp
- src/jsc/bindings/webcore/PerformanceUserTiming.cpp
- src/jsc/bindings/StrongRootBlock.h
Narrow the pattern to the quoted include form so a prose comment mentioning the header name cannot false-positive. The removed lines in this file were commented-out includes, so the quoted form still catches both live and commented #include directives.
JSS3File: BUN__createJSS3File has zero callers (born dead in #36588; only BUN__createJSS3FileUnsafely is wired to Rust). Remove it, constructS3File, the JSS3File__construct extern decl, and the Rust construct/construct_internal chain plus its now-unused PathLikeExt import. InspectorBunFrontendDevServerAgent.cpp: drop orphaned m_globalobject initializer comment and redundant UNUSED_PARAM (parameter is used). RequestContext.rs: drop stale TODO referencing the deleted InlineBlob type. Remove commented-out #include "JSDOMWindow.h" from the 5 remaining sibling files (DOMWrapperWorld, JSDOMWrapper, JSErrorHandler, JSDOMPromise, JSDOMPromiseDeferred). source-lints: add \b anchor so BunFrontendDevServerAgent__notify doesn't match the live InspectorBunFrontendDevServerAgent__notify* wrappers; broaden RequestContext/S3File guards to cover the new deletions.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@test/internal/source-lints/dead-symbols-webcore-inline-extern.test.ts`:
- Line 81: Update the Rust method regex guards in the dead-symbol test for
S3File so each removed method pattern is constrained to its owning impl block,
while still matching the intended construct_internal_js symbol and avoiding
unrelated methods or comments elsewhere in the file. Preserve the existing
JavaScript symbol checks and scope changes to the pattern entry for
src/runtime/webcore/S3File.rs.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: cc1ab9e3-d18a-443a-8cc1-0475302fac47
📒 Files selected for processing (11)
src/jsc/bindings/DOMWrapperWorld.cppsrc/jsc/bindings/InspectorBunFrontendDevServerAgent.cppsrc/jsc/bindings/JSDOMWrapper.cppsrc/jsc/bindings/JSS3File.cppsrc/jsc/bindings/JSS3File.hsrc/jsc/bindings/webcore/JSDOMPromise.cppsrc/jsc/bindings/webcore/JSDOMPromiseDeferred.cppsrc/jsc/bindings/webcore/JSErrorHandler.cppsrc/runtime/server/RequestContext.rssrc/runtime/webcore/S3File.rstest/internal/source-lints/dead-symbols-webcore-inline-extern.test.ts
💤 Files with no reviewable changes (10)
- src/jsc/bindings/DOMWrapperWorld.cpp
- src/jsc/bindings/webcore/JSDOMPromiseDeferred.cpp
- src/jsc/bindings/webcore/JSDOMPromise.cpp
- src/jsc/bindings/webcore/JSErrorHandler.cpp
- src/jsc/bindings/JSDOMWrapper.cpp
- src/jsc/bindings/JSS3File.h
- src/runtime/server/RequestContext.rs
- src/jsc/bindings/InspectorBunFrontendDevServerAgent.cpp
- src/jsc/bindings/JSS3File.cpp
- src/runtime/webcore/S3File.rs
JSWorkerOptions.cpp: JSFetchRequestCredentials.h / JSWorkerType.h (paired with the removed credentials/type parsing blocks). JSEventListener.cpp: BeforeUnloadEvent.h and adjacent commented-out includes (paired with the removed handleBeforeUnloadEventReturnValue helper).
|
CI status: the diff is green on the code it touches. Remaining failures are unrelated to this change:
Both [new] failures have been reported to main-break triage. Ready for review; needs a maintainer to merge past the unrelated lane failures. |
… and resolver/fs (#36803) Net: +47 / -1160. ## Removed - **`src/runtime/node/nodejs_error_code.rs`** (1113 lines): a 340-variant `enum Code` mirroring the Node.js `ERR_*` table. The sole reference outside its own module was `node_os.rs:269` doing `<&'static str>::from(ErrorCode::ERR_SYSTEM_ERROR)`, which just produces the string `"ERR_SYSTEM_ERROR"`. Three other call sites in the same file (`node_os.rs:938/1220/1539`) already use `BunString::static_("ERR_SYSTEM_ERROR")` directly, so the remaining one now does the same. The `jsc::ErrorCode` type (backed by `ErrorCode.generated.rs`) is the live `ERR_*` table; this enum was a parallel dead one. - `rg -n 'nodejs_error_code' src/ build/debug/codegen/ src/codegen/` → only the `mod` declaration and two explanatory comments (both updated). - **`dir_iterator::IteratorError`** (11 lines) + **`runtime::Error::DirIterator`** variant (3 lines): the enum is never constructed (`rg 'IteratorError::' src/ build/debug/codegen/` → 0 hits), so the `#[from]` on `Error::DirIterator` can never fire either. - **`VectorArrayBuffer::to_js`** (4 lines): every caller reads `.value` directly; `to_js` was never invoked and is not a trait impl. - **`src/resolver/fs.rs`** commented-out Zig stubs `statBatch/stat/readFile/readDir` (9 lines): never implemented. ## Verification ``` rg -w <symbol> src/ build/debug/codegen/ src/codegen/ bun bd bun run rust:check-all # 10 ok, 0 failed bun bd test test/js/node/os/ test/js/node/fs/fs.test.ts -t readdir bun bd test test/bundler/bundler_loader.test.ts bun bd test test/internal/source-lints/ ``` A source-lint test (`test/internal/source-lints/dead-symbols-nodejs-error-code.test.ts`) asserts none of these reappear. ## Also scanned (nothing removed) `src/http/**` (36 files), `src/install/**`, `src/resolver/**`, `src/ast/**`, `src/semver/**`, `src/valkey/**`, `src/sql/postgres/**`, `src/collections/**`. Several initial candidates turned out to have callers under a different crate or via method-call syntax: `collections::StringMap` (sql_jsc), `semver::string::ArrayHashContext` (install/lockfile), `NewWriter::{int8,f64,bun_string}` (sql_jsc), `Level::{gt,eql}` (js_parser), `SinglyLinkedList::len` (bake/memory_cost), `Target::is_node` (resolve_builtins), `{Parse,Decode}DataURLError::name()` (bundler/transpiler). No overlap with open dead-code PRs #36237, #35775, #36791, #36115, #35437, #35880. <!-- robobun:evidence:begin --> --- **[review]** gate passed · iteration 1 · 10 files touched <details><summary>fails on main (without fix)</summary> ```console ASAN without fix: 1 FAILED $ BUN_DEBUG_QUIET_LOGS=1 bun scripts/build.ts --profile=debug --quiet test "--reporter=junit" "--reporter-outfile=/tmp/mechgate.xml" test/internal/source-lints/dead-symbols-nodejs-error-code.test.ts bun test v1.4.0 (6071f67) test/internal/source-lints/dead-symbols-nodejs-error-code.test.ts: 24 | ["src/runtime/error.rs", /\bDirIterator\b/], 25 | ["src/runtime/node/types.rs", /impl VectorArrayBuffer \{\n pub fn to_js\(/], 26 | ["src/resolver/fs.rs", /pub fn statBatch\(fs: \*FileSystemEntry/], 27 | ]; 28 | const resurrected = checks.filter(([file, re]) => re.test(src(file))).map(([file, re]) => `${file}: ${re.source}`); 29 | expect(resurrected).toEqual([]); ^ error: expect(received).toEqual(expected) - [] + [ + "src/runtime/node.rs: \bnodejs_error_code\b", + "src/runtime/node/node_os.rs: crate::node::ErrorCode", + "src/runtime/node/dir_iterator.rs: \benum IteratorError\b", + "src/runtime/error.rs: \bDirIterator\b", + "src/runtime/node/types.rs: impl VectorArrayBuffer \{\n pub fn to_js\(", + "src/resolver/fs.rs: pub fn statBatch\(fs: \*FileSystemEntry", + ] - Expected - 1 + Received + 8 at <ano ... (truncated) release without fix: 1 FAILED bun test v1.4.0-canary.1 (a6ff9d1) test/internal/source-lints/dead-symbols-nodejs-error-code.test.ts: 24 | ["src/runtime/error.rs", /\bDirIterator\b/], 25 | ["src/runtime/node/types.rs", /impl VectorArrayBuffer \{\n pub fn to_js\(/], 26 | ["src/resolver/fs.rs", /pub fn statBatch\(fs: \*FileSystemEntry/], 27 | ]; 28 | const resurrected = checks.filter(([file, re]) => re.test(src(file))).map(([file, re]) => `${file}: ${re.source}`); 29 | expect(resurrected).toEqual([]); ^ error: expect(received).toEqual(expected) - [] + [ + "src/runtime/node.rs: \bnodejs_error_code\b", + "src/runtime/node/node_os.rs: crate::node::ErrorCode", + "src/runtime/node/dir_iterator.rs: \benum IteratorError\b", + "src/runtime/error.rs: \bDirIterator\b", + "src/runtime/node/types.rs: impl VectorArrayBuffer \{\n pub fn to_js\(", + "src/resolver/fs.rs: pub fn statBatch\(fs: \*FileSystemEntry", + ] - Expected - 1 + Received + 8 at <anonymous> (/workspace/bun/test/internal/source-lints/dead-symbols-nodejs-error-code.test.ts:29:23) (fail) dead Rust symbols in runtime/node + resolver do not reappear [0.74ms] 0 pass 1 fail ... (truncated) ``` </details> <details><summary>passes on PR (with fix)</summary> ```console ASAN with fix: all passed $ BUN_DEBUG_QUIET_LOGS=1 bun scripts/build.ts --profile=debug --quiet test "--reporter=junit" "--reporter-outfile=/tmp/mechgate.xml" test/internal/source-lints/dead-symbols-nodejs-error-code.test.ts bun test v1.4.0 (6071f67) test/internal/source-lints/dead-symbols-nodejs-error-code.test.ts: (pass) dead Rust symbols in runtime/node + resolver do not reappear [30.31ms] 1 pass 0 fail 1 expect() calls Ran 1 test across 1 file. [2.02s] __F:0:S:0 release with fix: all passed $ bun scripts/build.ts --profile=release [configured] bun-profile → bun (stripped) in 652ms (unchanged) ninja: Entering directory `/workspace/bun/build/release' [1/73] gen ErrorCode+*.h [2/11] gen cpp.rs (cppbind) [3/11] gen BunProcess.lut.h Generating /workspace/bun/build/release/codegen/BunProcess.lut.h from /workspace/bun/src/jsc/bindings/BunProcess.cpp [4/11] gen generated_host_exports.rs generated_host_exports.rs: 94 exports (host=3, lazy=10, generic=81, rust=0); 238 extern-C blocks audited [4/11] cargo bun_bin → libbun_rust.a (--target x86_64-unknown-linux-gnu) nightly-2026-07-20-x86_64-unknown-linux-gnu unchanged - rustc 1.99.0-nightly (9f36de775 2026-07-19) �[1m�[92m Compiling�[0m bun_resolver v0.0.0 (/workspace/bun/src/resolver) �[1m�[92m Compiling�[0m bun_router v0.0.0 (/workspace/bun/src/router) �[1m�[92m Compiling�[0m bun_bundler v0.0.0 (/workspace/bun/src/bundler) �[1m�[92m Compiling�[0m bun_standalone_graph v0.0.0 (/workspace/bun/src/standalone_graph) �[1m�[92m Compiling�[0m bun_transpiler v0.0.0 (/workspace/bun/src/transpiler) �[1m�[92m Compiling�[0m bun_bunfig v0.0.0 (/workspace/bun/src/bunfig) �[1m�[92m Compiling�[0m bun_instal ... (truncated) ``` </details> <details><summary>diff hotspot</summary> ``` src/jsc/ErrorCode.rs | 14 +- src/jsc/lib.rs | 4 +- src/resolver/fs.rs | 9 - src/runtime/error.rs | 3 - src/runtime/node.rs | 4 - src/runtime/node/dir_iterator.rs | 11 - src/runtime/node/node_os.rs | 4 +- src/runtime/node/nodejs_error_code.rs | 1113 -------------------- src/runtime/node/types.rs | 4 - .../dead-symbols-nodejs-error-code.test.ts | 30 + 10 files changed, 35 insertions(+), 1161 deletions(-) ``` </details> **gate history** · 1 passed · 1 rejected · iteration 1 <details><summary>evidence per changed file</summary> ``` file reads edits tests src/jsc/ErrorCode.rs 3 3 0 src/jsc/lib.rs 1 1 0 src/resolver/fs.rs 1 1 0 src/runtime/error.rs 1 1 0 src/runtime/node.rs 1 1 0 src/runtime/node/dir_iterator.rs 1 1 0 src/runtime/node/node_os.rs 1 1 0 src/runtime/node/nodejs_error_code.rs 0 0 0 src/runtime/node/types.rs 1 1 0 …nal/source-lints/dead-symbols-nodejs-error-code.test.ts 2 4 0 ``` </details> <!-- robobun:evidence:end --> --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Net -817 lines (+82 / -899) across 39 files. Every removed symbol was verified via
rgacrosssrc/andbuild/debug/codegen/to have zero remaining references;bun bdandbun run rust:check-all(all CI target triples) pass.Whole-file deletions (C++ headers)
src/jsc/bindings/TextCodecASCIIFastPath.h(78 lines): never#included anywhere undersrc/,scripts/,cmake/, or generated code. DefinesPAL::UCharByteFiller/PAL::copyASCIIMachineWord, neither referenced.src/jsc/bindings/webcore/Node.h(108 lines): definesWebCore::Nodewhich is never instantiated, subclassed, or referenced as a type. NoWTF_MAKE_TZONE_ALLOCATED_IMPL(Node)exists so it could never link. Removed the two#include "Node.h"lines inWebCoreOpaqueRoot.handEventTargetHeaders.h(neither file uses the type).src/jsc/bindings/webcore/JSDOMWindow.h,JSServiceWorker.h,JSWindowProxy.h: one-line stub headers. Removed their#includesites inJSMessageEvent.cpp,JSMessageEventCustom.cpp, and the commented-out includes inJSEventTargetCustom.cpp.Dead
extern "C"exports (lost their Rust caller in #35002)highway_strings.cpp:highway_char_frequency+ScanCharFrequencyImpl(69-line SIMD body) +HWY_EXPORT. Whole-reporg -w highway_char_frequency= 1 hit (its own definition).TextCodecWrapper.cpp:Bun__isEncodingSupported,Bun__getCanonicalEncodingName. Whole-reporg= 1 hit each.StrongRef.cpp/.h:Bun__StrongRef__get,Bun__StrongRef__clear.src/jsc/Strong.rsonly declaresnew/set/delete; reads go through a direct pointer load per the comment atStrongRef.cpp:19-26. Also removedStrongRootBlock::clearValuewhich was only called fromBun__StrongRef__clear.InspectorLifecycleAgent.cpp:Bun__LifecycleAgentReportReloadwrapper +InspectorLifecycleAgent::reportReload()method + header decl. No Rust caller.InspectorBunFrontendDevServerAgent.cpp:InspectorBunFrontendDevServerAgent__notifyClientErrorReported/notifyGraphUpdatewrappers +clientErrorReported()/graphUpdate()class methods + header decls.inspector_agent.rsdeclares the 7 siblingnotify*wrappers but not these two.InspectorBunFrontendDevServerAgent.h: removed the stale 9-entryextern "C"block that declaredBunFrontendDevServerAgent__notify*(noInspectorprefix), which never matched the actualInspectorBunFrontendDevServerAgent__notify*definitions or the Rust imports.JSS3File.cpp:static bool customHasInstance(...)is a file-scope static function, never referenced in the file.JSS3File'sStructureFlagsisBase::StructureFlagswith noImplementsHasInstance, soCREATE_METHOD_TABLEcannot pick it up. Removed the matchingJSS3File__hasInstanceforward decl, thehas_instancehelper inS3File.rs, and its#[no_mangle]export whose only caller was this static.Commented-out C++ (>6 months stale per
git blame)JSTextEncoder.cpp: disabled DOMJIT declarations,DOMJIT::Signaturestatics,HashTableValueentries, and twoJSC_DEFINE_JIT_OPERATIONbodies (83 lines total). Commented out since 2024-09; the non-DOMJITencode/encodeIntoentries remain.JSURLSearchParams.cpp,JSErrorEvent.cpp,JSDOMException.cpp:#if ENABLE(BINDING_INTEGRITY)vtable-pointer scaffolding inside and beforetoJSNewlyCreated. Commented out since 2022-03.JSPerformance.cpp,JSDOMURL.cpp:JSDOMWindowBase-gateddeletePropertypaths infinishCreation/initializeProperties. Commented out since 2024.JSWorkerOptions.cpp:credentials/typedictionary-member parsing. Commented out since 2023-07 / 2025-01.JSEventListener.cpp:handleBeforeUnloadEventReturnValuehelper and its call site. Commented out since 2022-03.PerformanceUserTiming.cpp:restrictedMarkFunctionslookup insideconvertMarkToTimestamp. Commented out since 2024-01.Rust
Blob.rs:pub struct Inline+impl Inline+impl Default for Inline(48 lines).rg 'InlineBlob|blob::Inline'shows every reference is inside a//comment; theAnyenum atBlob.rs:6353has noInlinevariant.Body.rs,server/RequestContext.rs: removed the commented-outInlineBlobmatch arms that referenced the deleted struct.S3File.rs:has_instance+JSS3File__hasInstanceexport (only caller was the removed C++ static; see above).streams.rs:BufferAction::get(zero callers; all.get()calls onbuffer_actionresolve toJsCell::get).FileReader.rs:pub const TAG(zero references).src/js (>6 months stale per
git blame)builtins/Ipc.ts: 131-line commented-outhandleConversionmap (net.Server/net.Socket/dgram.*). Blame 2025-05-06.internal/fs/streams.ts: commented-outfastPath._getFd()block. Blame 2025-01-25.node/worker_threads.ts: two commented-out type imports. Blame 2023-08-07.Verification
bun bd: builds cleanbun run rust:check-all: 10 ok, 0 failed (all target triples)text-encoder.test.js(42 pass),worker_threads.test.ts(91 pass),body.test.ts(448 pass),url.test.ts(18 pass),performance.test.js(7 pass)test/internal/source-lints/dead-symbols-webcore-inline-extern.test.tsadded: fails onmain(every check matches), passes after this diffFollowups (not in this diff)
BunFrontendDevServerFrontendDispatcher::clientErrorReported/graphUpdateandLifecycleReporterFrontendDispatcher::reloadin the generated inspector protocol are now unreferenced from C++; trimming those lives in the protocol JSON, out of scope here. Downstream consumers that were already inert before this PR (no Rust producer ever existed): theLifecycleReporter.reloadlistener inpackages/bun-vscode/src/features/diagnostics/diagnostics.ts, theReloadEventtype inpackages/bun-inspector-protocol/src/protocol/jsc/index.d.ts, and the twotest.todoblocks waiting onclientErrorReported/graphUpdateintest/cli/inspect/BunFrontendDevServer.test.ts.Scanned and found clean (no confident dead symbols):
src/install/(lockfile/npm/migration/yarn/bin/isolated_install),src/sql/postgres/,src/http/(websocket, h3_client, AsyncHTTP, HTTPThread, etc.),src/semver/,src/resolver/,src/ast/,src/collections/,src/bun_core/,src/runtime/api/,src/runtime/node/,src/dotenv/,src/patch/,src/glob/,src/event_loop/,src/threading/,src/uws/,src/crash_handler/,src/valkey/,src/runtime/socket/.[review] gate passed · iteration 2 · 46 files touched
fails on main (without fix)
passes on PR (with fix)
diff hotspot
gate history · 3 passed · 1 rejected · iteration 2
evidence per changed file