Repository navigation
Prep for only parsing es modules once in jsc - #73
Merged
Merged
Conversation
robobun
added a commit
that referenced
this pull request
Aug 10, 2026
…gger/cache/completion switches #73 added SourceProviderSourceType::BunTranspiledModule so Bun can attach a pre-computed module record to a SourceProvider and skip JSC's analyze-phase re-parse. Three sites that branch on the provider's sourceType() still match only ::Module, so a BunTranspiledModule provider falls through: - debugger/DebuggerParseData.cpp gatherDebuggerParseDataForSource: falls to the default:false arm, Debugger::resolveBreakpoint gets empty pause positions, and Debugger.setBreakpoint replies "Could not resolve breakpoint" for every line in the script. - runtime/CachedTypes.cpp CachedSourceProvider encode/decode: would RELEASE_ASSERT_NOT_REACHED() if JSC bytecode caching encoded one of these providers. - runtime/Completion.cpp getSourceType: returns ScriptFetchParameters::Type::None instead of JavaScript. (InspectorDebuggerAgent::didParseSource, the fourth site in the original version of this change, is covered since the upstream merge in #383 by scriptTypeForScript.) Currently reachable in Bun via `bun test --isolate` and `--compile` standalone executables; oven-sh/bun#35605 routes every runtime ESM provider through this type and is blocked on this. Each site adds a BUN_JSC_ADDITIONS-gated case that falls through to the Module arm.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds an extern function Bun__analyzeTranspiledModule that is used get the ModuleRecord for a module if it is of type BunTranspiledModule