Skip to content

node:vm: name a Script built without options evalmachine.<anonymous> - #38318

Open
robobun wants to merge 2 commits into
mainfrom
farm/444054b8/vm-script-default-filename
Open

robobun wants to merge 2 commits into
mainfrom
farm/444054b8/vm-script-default-filename

Conversation

@robobun

@robobun robobun commented Aug 14, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

  • A vm.Script built without an options argument registers its source under an empty filename, so its stack frames print as at file:///:1:10 and CallSite.getFileName() returns "file:///". Node names it evalmachine.<anonymous> (lib/vm.js: filename = 'evalmachine.<anonymous>' destructuring default).
  • Affected shapes on current main: new Script(code), new Script(code, { filename: undefined }), vm.createScript(code), vm.runInThisContext(code), and { filename: undefined } passed to any of the vm.runIn* wrappers. (vm.runInContext(code, ctx) and vm.runInNewContext(code) without options stopped being affected when node:vm: reject array and function options like Node's validateObject #38381 made those two wrappers spread options into a fresh object; bun 1.4.0 still shows them.) The compile-time SyntaxError from new Script("%%") has the same problem in its frame (at <parse> (:1)); only its arrow header was already right.
  • new Script(code, {}) was already correct, so the two shapes disagreed.
  • Cause: constructScript started from ScriptOptions options(""_s) (src/jsc/bindings/NodeVMScript.cpp:106) and the evalmachine.<anonymous> default lived inside BaseVMOptions::fromJS (src/jsc/bindings/NodeVM.cpp:1963), which only runs that branch when an options object exists and has no filename key. No options object, or filename: undefined, never reached it, and the empty name then rendered through the SourceOrigin fallback as file:///.

Fix

  • ScriptOptions now seeds filename with evalmachine.<anonymous> in its constructor; BaseVMOptions::fromJS only overwrites filename when options.filename is a string. The default is therefore in effect for every call shape, and a provided filename (string argument or filename: property, "" included) still replaces it, as in Node.
  • Why here: fromJS is a parser shared by Script, compileFunction and the run options, and the APIs have different defaults (Node's compileFunction defaults to ""). Putting the Script default in the parser is what forced CompileFunctionOptions::fromJS to undo it afterwards and constructScript to track filenameProvided for its header. With the default on ScriptOptions, both workarounds are dead and are removed, and the compile-error header just uses options.filename like compileFunction already did.
  • compileFunction keeps its empty default (default-constructed options, same as the reset produced before); an explicit "" still renders the compile-error header as :1 (existing tests in vm.test.ts pin both).
  • Not changed here, pre-existing and byte-identical before and after this PR: how an explicitly empty name renders in runtime frames (file:///, Node prints <anonymous>), and the runtime arrow header in handleException (NodeVM.cpp:561-567), which is built from the error's top frame and still substitutes evalmachine.<anonymous> for an empty URL (it renders evalmachine.<anonymous>:1 for an explicit "" where Node renders :1, and [native code]:0 when a builtin threw). That is a frame-selection problem in handleException and is left for a separate change. The SourceTextModule counterpart (frames named after the module identifier) is node:vm: apply SourceTextModule lineOffset/columnOffset like Node and name frames after the identifier #38235.
  • The two hunks in the binding-level runInNewContext/runInThisContext host functions in NodeVM.cpp are compile fixes, not behavior: those functions are unreachable (vm.ts builds both APIs on Script and never calls them), and they were the only users of the three-argument BaseVMOptions constructor, which is deleted here along with ScriptOptions' inherited constructors. node:vm: keep lineOffset/columnOffset from overflowing JSC parser positions #38228 deletes the functions themselves; whichever of the two lands second resolves by taking that deletion.
  • Tests: test/js/node/vm/vm.test.ts. "defaults the filename to evalmachine. like Node" runs inside the shared matrix, so it covers vm.runInContext/runInNewContext/runInThisContext and the three Script.prototype.runIn* paths, each with no options, { filename: undefined }, and { filename: "" } (must stay non-default). "the source itself is named evalmachine. when no filename is given" covers new Script with undefined/{}/{ filename: undefined }, createScript, the string form ("named.js" and ""), CallSite.getFileName(), and the compile-time SyntaxError stacks, which must be identical across the three shapes.
  • Verified: the 7 new tests fail on the released bun (USE_SYSTEM_BUN=1) and on a debug build of current main's src/ (at file:///:1:10; the two vm.runInContext/runInNewContext cases fail on their { filename: undefined } assertion), and pass with the fix (bun bd test test/js/node/vm/vm.test.ts: 257 pass). All 97 vendored test/js/node/test/parallel/test-vm-* files, the three sequential/test-vm-* files, and the vendored buffer/util/repl tests that use node:vm pass on the fixed build; test-vm-basic.js in particular still pins compileFunction's empty-name frames. The new tests also pass under BUN_JSC_validateExceptionChecks=1.

Background

  • BaseVMOptions (NodeVM.h) holds the filename/lineOffset/columnOffset common to the vm option bags; ScriptOptions (new Script), CompileFunctionOptions (vm.compileFunction) and RunningScriptOptions (runIn*Context on an existing script) derive from it and call BaseVMOptions::fromJS to read those properties from the user's options object.
  • The filename becomes the sourceURL of the JSC SourceCode the script is compiled from. Stack frames, CallSite.getFileName() and the <url>:<line> arrow header Bun prepends to vm errors all read it. When it is empty, Bun's stack formatter falls back to the SourceOrigin URL, which for a vm script is fileURLWithFileSystemPath(filename), i.e. file:/// for an empty name; that fallback is why the bug showed up as file:///.
  • src/js/node/vm.ts implements runInContext, runInNewContext, runInThisContext and createScript on top of new Script(code, options), which is why they share the constructor's bug. Since node:vm: reject array and function options like Node's validateObject #38381 the first two copy options into a fresh object first, so for them only a present-but-undefined filename still reaches the bug.
Before / after (bun 1.4.0 vs. this branch; node v26.3.0 for reference)
                                          before                       after / node
new Script(code)                          at file:///:1:10             at evalmachine.<anonymous>:1:10
new Script(code, {})                      at evalmachine.<anonymous>   at evalmachine.<anonymous>:1:10
new Script(code, {filename: undefined})   at file:///:1:10             at evalmachine.<anonymous>:1:10
createScript(code)                        at file:///:1:10             at evalmachine.<anonymous>:1:10
runInThisContext(code)                    at file:///:1:10             at evalmachine.<anonymous>:1:10
runInContext(code, ctx)                   at file:///:1:10 (*)         at evalmachine.<anonymous>:1:10
runInNewContext(code)                     at file:///:1:10 (*)         at evalmachine.<anonymous>:1:10
runIn*(…, {filename: undefined})          at file:///:1:10             at evalmachine.<anonymous>:1:10
getFileName(), no options                 "file:///"                   "evalmachine.<anonymous>"
new Script("%%") frame                    at <parse> (:1)              at <parse> (evalmachine.<anonymous>:1)

(*) already evalmachine.<anonymous> on main since #38381; still file:/// in 1.4.0.

unchanged:
new Script(code, "") / {filename: ""}     at file:///:1:10 (node: at <anonymous>:1:1); compile header ":1" in both
compileFunction(...) without filename     compile header ":1", frames file:/// (pinned by vendored test-vm-basic.js)

(Node reports column 1 where JSC reports the column of the new Error expression; the tests only check the name.)


[review] gate passed · iteration 1 · 5 files touched

fails on main (without fix)
ASAN without fix: 7 failed, 62 skipped
$ BUN_DEBUG_QUIET_LOGS=1 bun scripts/build.ts --profile=debug --quiet test "--reporter=junit" "--reporter-outfile=/tmp/mechgate.xml" test/js/node/vm/vm.test.ts
bun test v1.4.0 (8d95f75c3)

test/js/node/vm/vm.test.ts:
(pass) vm > runInContext() > can do nothing [22.56ms]
(pass) vm > runInContext() > can return a value [15.10ms]
(pass) vm > runInContext() > can return a complex value [15.27ms]
(pass) vm > runInContext() > can return the last value [14.97ms]
(pass) vm > runInContext() > new ArrayBuffer() in VM context doesn't crash [16.81ms]
(pass) vm > runInContext() > new SharedArrayBuffer() in VM context doesn't crash [13.32ms]
(pass) vm > runInContext() > new Uint8Array() in VM context doesn't crash [15.45ms]
(pass) vm > runInContext() > new Int8Array() in VM context doesn't crash [15.33ms]
(pass) vm > runInContext() > new Uint16Array() in VM context doesn't crash [15.42ms]
(pass) vm > runInContext() > new Int16Array() in VM context doesn't crash [15.06ms]
(pass) vm > runInContext() > new Uint32Array() in VM context doesn't crash [14.21ms]
(pass) vm > runInContext() > new Int32Array() in VM context doesn't crash [14.69ms]
(pass) vm > runInContext() > new Float32Arr
... (truncated)

release without fix: 29 failed, 62 skipped
bun test v1.4.0-canary.1 (b7a043103)

test/js/node/vm/vm.test.ts:
(pass) vm > runInContext() > can do nothing [0.35ms]
(pass) vm > runInContext() > can return a value [0.21ms]
(pass) vm > runInContext() > can return a complex value [0.20ms]
(pass) vm > runInContext() > can return the last value [0.19ms]
(pass) vm > runInContext() > new ArrayBuffer() in VM context doesn't crash [0.23ms]
(pass) vm > runInContext() > new SharedArrayBuffer() in VM context doesn't crash [0.15ms]
(pass) vm > runInContext() > new Uint8Array() in VM context doesn't crash [0.15ms]
(pass) vm > runInContext() > new Int8Array() in VM context doesn't crash [0.17ms]
(pass) vm > runInContext() > new Uint16Array() in VM context doesn't crash [0.21ms]
(pass) vm > runInContext() > new Int16Array() in VM context doesn't crash [0.16ms]
(pass) vm > runInContext() > new Uint32Array() in VM context doesn't crash [0.13ms]
(pass) vm > runInContext() > new Int32Array() in VM context doesn't crash [0.14ms]
(pass) vm > runInContext() > new Float32Array() in VM context doesn't crash [0.14ms]
(pass) vm > runInContext() > new Float64Array() in VM context doesn't crash [0.14ms]
(pass) vm > runInContext() > new Big
... (truncated)
passes on PR (with fix)
ASAN with fix: 62 skipped
$ BUN_DEBUG_QUIET_LOGS=1 bun scripts/build.ts --profile=debug --quiet test "--reporter=junit" "--reporter-outfile=/tmp/mechgate.xml" test/js/node/vm/vm.test.ts
bun test v1.4.0 (8d95f75c3)

test/js/node/vm/vm.test.ts:
(pass) vm > runInContext() > can do nothing [23.24ms]
(pass) vm > runInContext() > can return a value [14.97ms]
(pass) vm > runInContext() > can return a complex value [15.45ms]
(pass) vm > runInContext() > can return the last value [14.41ms]
(pass) vm > runInContext() > new ArrayBuffer() in VM context doesn't crash [16.10ms]
(pass) vm > runInContext() > new SharedArrayBuffer() in VM context doesn't crash [13.52ms]
(pass) vm > runInContext() > new Uint8Array() in VM context doesn't crash [15.45ms]
(pass) vm > runInContext() > new Int8Array() in VM context doesn't crash [15.27ms]
(pass) vm > runInContext() > new Uint16Array() in VM context doesn't crash [15.25ms]
(pass) vm > runInContext() > new Int16Array() in VM context doesn't crash [14.60ms]
(pass) vm > runInContext() > new Uint32Array() in VM context doesn't crash [14.60ms]
(pass) vm > runInContext() > new Int32Array() in VM context doesn't crash [14.61ms]
(pass) vm > runInContext() > new Float32Arr
... (truncated)

release with fix: 62 skipped
$ bun scripts/build.ts --profile=release
[configured] bun-profile → bun (stripped)
  target       linux-x64-gnu
  build type   Release
  build dir    ./build/release
  revision     8d95f75c38
  features     baseline

22 deps, 123 codegen, 1176 objects in 639ms

ninja: Entering directory `/workspace/bun/build/release'
[1/1238] gen ErrorCode+*.h
[2/1238] gen bindgenv2
[3/1238] install /workspace/bun
bun install v1.4.0-canary.1 (b7a043103)

Checked 107 installs across 153 packages (no changes) [39.00ms]
[4/1238] install /workspace/bun/packages/bun-error
bun install v1.4.0-canary.1 (b7a043103)

Checked 1 install across 2 packages (no changes) [1.00ms]
[5/1238] fetch tinycc
[tinycc] up to date
[6/1237] fetch zlib
[zlib] up to date
[7/1237] fetch libjpeg-turbo
[libjpeg-turbo] up to date
[8/1237] gen ProcessBindingConstants.lut.h
Generating /workspace/bun/build/release/codegen/ProcessBindingConstants.lut.h from /workspace/bun/src/jsc/bindings/ProcessBindingConstants.cpp
[9/1237] install /workspace/bun/src/node-fallbacks
bun install v1.4.0-canary.1 (b7a043103)

Checked 129 installs across 147 packages (no changes) [10.00ms]
[10/1237] gen .bind.ts → GeneratedBindings.cpp
... (truncated)
diff hotspot
src/jsc/bindings/NodeVM.cpp       | 25 ++-------------
 src/jsc/bindings/NodeVM.h         |  6 ++--
 src/jsc/bindings/NodeVMScript.cpp |  9 ++----
 src/jsc/bindings/NodeVMScript.h   |  6 +++-
 test/js/node/vm/vm.test.ts        | 66 +++++++++++++++++++++++++++++++++++++++
 5 files changed, 77 insertions(+), 35 deletions(-)

gate history · 1 passed · 0 rejected · iteration 1

evidence per changed file
file                               reads  edits  tests
src/jsc/bindings/NodeVM.cpp            5      8      0
src/jsc/bindings/NodeVM.h              1      2      0
src/jsc/bindings/NodeVMScript.cpp      2      3      0
src/jsc/bindings/NodeVMScript.h        2      2      0
test/js/node/vm/vm.test.ts             7      5      0

@coderabbitai

coderabbitai Bot commented Aug 14, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@robobun, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 2 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: fea0720f-3327-42ae-8a27-b5f55bdb74d1

📥 Commits

Reviewing files that changed from the base of the PR and between 840eac2 and 8d95f75.

📒 Files selected for processing (5)
  • src/jsc/bindings/NodeVM.cpp
  • src/jsc/bindings/NodeVM.h
  • src/jsc/bindings/NodeVMScript.cpp
  • src/jsc/bindings/NodeVMScript.h
  • test/js/node/vm/vm.test.ts

Comment @coderabbitai help to get the list of available commands.

@robobun

robobun commented Aug 14, 2026 •

Copy link
Copy Markdown
Collaborator Author

Status

  • Reproduced on bun 1.4.0 and on a debug build of main: new vm.Script("new Error('x').stack").runInThisContext() reports at file:///:1:10; with {} it reports at evalmachine.<anonymous>:1:10; node v26.3.0 reports evalmachine.<anonymous> for both. Same for { filename: undefined }, vm.createScript(code) and vm.runInThisContext(code) (and, before node:vm: reject array and function options like Node's validateObject #38381 landed, vm.runInContext/vm.runInNewContext without options).
  • Fix and tests are in this PR (test/js/node/vm/vm.test.ts): the 7 new tests fail with main's src/ and pass with the fix (257 pass on current main). The vendored test-vm-* suite (97 parallel + 3 sequential files) passes on the fixed build.
  • Self-review found no blocking issues; the PR body spells out the two compile-fix hunks in unreachable NodeVM.cpp host functions (which node:vm: keep lineOffset/columnOffset from overflowing JSC parser positions #38228 deletes) and the pre-existing handleException header fallback that is out of scope here.
  • CI, build 95785 (current head 8d95f75, rebased onto main): 177 of 179 jobs passed, including every lane that ran the new tests. The remaining 2 are the darwin 14 aarch64 - test-bun jobs, which expired after 5h without ever being picked up by an agent; the test-darwin queue is backlogged for every current build, main's included, so a fresh build would only queue behind it. Retrying those two jobs in Buildkite is enough to get a darwin result (my token cannot retry jobs). The darwin failures in the earlier build 95276 (astro-post.test.js, vite-build.test.ts aborting in pthread_atfork) were the mimalloc bug fixed on main by mimalloc: register fork handlers once per process (fixes macOS abort in astro/vite builds); build: --local-deps #38291, which this branch now includes.
  • Ready for review.

@claude claude Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM — moves the evalmachine.<anonymous> default to the ScriptOptions constructor so it applies to every call shape, and deletes the filenameProvided / CompileFunctionOptions reset workarounds that only existed because the default lived in the shared parser.

Checked: compileFunction still gets a null default filename (both the no-options reset path and the {}-options path), RunningScriptOptions.filename is unused so its unchanged empty default is harmless, and no other call sites construct ScriptOptions/BaseVMOptions with the removed three-arg form. Also noted the removed unconditional optionsArg.toWTFString(...) in the two binding-level host functions was itself a latent missing-exception-check on an object arg's toString, so this is a net cleanup there too. Tests cover the full option-shape matrix plus the negative (filename: "" stays non-default), CallSite.getFileName(), and compile-time SyntaxError stacks; Error.prepareStackTrace is restored in finally.

Extended reasoning...

Overview

This PR fixes node:vm so that a Script (and every entry point built on it — createScript, runInContext/runInNewContext/runInThisContext) constructed without a filename names its source evalmachine.<anonymous> like Node, instead of the empty string that rendered as file:/// in stack frames. It touches four files in src/jsc/bindings/ (NodeVM.{h,cpp}, NodeVMScript.{h,cpp}) and adds tests to test/js/node/vm/vm.test.ts.

The mechanism is a small refactor: the default used to live inside BaseVMOptions::fromJS (only reached when an options object is passed and lacks filename), forcing constructScript to seed "" and track filenameProvided, and forcing CompileFunctionOptions::fromJS to undo the default afterwards. The default now lives in ScriptOptions(), fromJS only overwrites when options.filename is a string, and both workarounds plus the now-unused three-arg BaseVMOptions constructor are deleted.

Security risks

None. This changes only the default source-URL string attached to a compiled vm script for stack-trace display. No auth, crypto, permissions, memory, or lifetime code is touched.

Level of scrutiny

Moderate — it's C++ in the JSC bindings, so I traced every consumer of the changed types. BaseVMOptions/ScriptOptions are referenced only in the four edited files; ScriptOptions is now only default-constructed (three sites, all updated) and moved (implicit move ctor is still generated since only a user-declared default constructor was added). CompileFunctionOptions keeps using BaseVMOptions::BaseVMOptions and is only default-constructed, so its filename stays null — identical to what the removed reset produced. RunningScriptOptions also inherits base constructors and is only default-constructed; its filename is written but never read (the script's SourceCode is already built), so its unchanged empty default is inert. The two binding-level host functions that dropped ScriptOptions options(optionsArg.toWTFString(globalObject), …) also lose an unchecked coercion that could run a user toString; the new code only coerces after the isString() guard with a proper RETURN_IF_EXCEPTION.

Other factors

The tests are thorough per the repo's review rules: they run inside the shared testRunInContext matrix (covering all six runIn* entry points), assert the negative case (filename: "" is not replaced), check both option forms (string and object), check CallSite.getFileName(), and pin that the three no-filename shapes produce byte-identical compile-error stacks. Global mutation (Error.prepareStackTrace) is restored in finally. The PR description confirms the tests fail under USE_SYSTEM_BUN=1, pass on the fixed build (221 pass), pass under BUN_JSC_validateExceptionChecks=1, and that all vendored test-vm-* files (including test-vm-basic.js which pins compileFunction's empty-name behavior) still pass. Net src/ change is small and strictly simplifying.

new vm.Script(code), vm.createScript(code), vm.runInThisContext(code),
vm.runInContext(code, ctx) and vm.runInNewContext(code) registered their
source under an empty filename, so stack frames and CallSite.getFileName()
reported file:/// instead of evalmachine.<anonymous>. The same happened
for { filename: undefined }. Only an options object without a filename key
got the default, because it was applied inside BaseVMOptions::fromJS.

Seed ScriptOptions with Node's default instead and let fromJS only
overwrite it with a provided string. That makes the filenameProvided flag
and the compileFunction reset (which undid the fromJS default to keep its
own empty default) unnecessary, so both are removed. An explicit "" is
still kept as is, and compileFunction still defaults to an empty name.
@robobun
robobun force-pushed the farm/444054b8/vm-script-default-filename branch from 718caaf to 8fdcca7 Compare August 14, 2026 08:54
Comment thread src/jsc/bindings/NodeVMScript.h Outdated
@robobun

robobun commented Aug 14, 2026 •

Copy link
Copy Markdown
Collaborator Author
Updated 7:05 AM PT - Aug 14th, 2026

❌ @robobun, your commit 8d95f75 has some failures in Build #95785 (All Failures)


🧪   To try this PR locally:

bunx bun-pr 38318

That installs a local version of the PR into your bun-38318 executable, so you can run:

bun-38318 --bun

@claude claude Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM — moves the evalmachine.<anonymous> default to the ScriptOptions constructor so every call shape sees it, and removes the filenameProvided tracking and CompileFunctionOptions reset that only existed to compensate for the old placement.

What was reviewed:

  • Confirmed filenameProvided and the three-arg BaseVMOptions constructor have no remaining callers.
  • Verified CompileFunctionOptions (still using BaseVMOptions::BaseVMOptions) keeps its empty-string default now that fromJS no longer overwrites it, and RunningScriptOptions.filename is unused for the actual source.
  • Checked src/js/node/vm.ts — the two edited vmModuleRunIn* host functions are indeed unreachable (all wrappers go through new Script).
  • Tests cover the three no-filename shapes, explicit "", string-form options, CallSite.getFileName(), and compile-time SyntaxError stacks; prepareStackTrace is restored in finally.
Extended reasoning...

Overview

This PR fixes node:vm so a Script built without an options argument (or with {filename: undefined}) is named evalmachine.<anonymous> in stack frames and CallSite.getFileName(), matching Node. Previously only new Script(code, {}) got the default; other shapes fell through to an empty filename that rendered as file:///.

The fix moves the default from a branch inside BaseVMOptions::fromJS (which only ran when an options object was present and lacked the key) into the ScriptOptions default constructor, and makes fromJS leave the constructor's value alone unless options.filename is a string. That lets the PR delete the filenameProvided field, the compensating reset in CompileFunctionOptions::fromJS, and the now-unused three-arg BaseVMOptions constructor. The two vmModuleRunIn* host functions in NodeVM.cpp are updated only because they were the last users of that constructor; vm.ts builds those APIs on Script and never calls them.

Security risks

None. This changes only the default string used as a source URL for stack frames; no auth, crypto, filesystem, or user-input parsing is involved.

Level of scrutiny

Node compat in C++ JSC bindings, but the change is pure default-value plumbing: one constant moves from a parser branch to a constructor, and dead compensation code is removed. There is no memory management, no new exception paths (the removed unconditional toWTFString in the unreachable host functions actually drops one), no GC/threading. I traced each subclass of BaseVMOptions through the new flow: ScriptOptions gets the Node default in every shape; CompileFunctionOptions keeps its empty-string default via BaseVMOptions() = default; RunningScriptOptions.filename is never used for the compiled source (the Script already carries it).

Other factors

Test coverage is thorough — the shared testRunInContext matrix exercises all six run entry points, and the new standalone test pins new Script/createScript shapes, the string-options form, explicit "", getFileName(), and identical compile-error stacks. The PR body reports the tests fail on both released Bun and a debug build of main, pass with the fix, and that all vendored test-vm-* files pass under BUN_JSC_validateExceptionChecks=1. The comment-cop bot's note about a long comment was addressed in 8d95f75 (thread resolved). No CODEOWNERS cover these paths.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant