The test now properly verifies that when sourceCodePreview is disabled:
- console.log() output still appears in stdout (program runs normally)
- The source code line containing 'console.log' does NOT appear in stderr
(source code preview is truly disabled)
This confirms that the error formatting doesn't show the source code,
while the actual program execution and console.log output still work.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Update test to:
- Throw actual errors instead of console.log(stack) to trigger source preview
- Check that source code lines with 'console.log' don't appear in output
- Verify source code preview shows line numbers and pipes in default mode
- Verify caret indicators (^) are present in default mode
- Ensure source code lines and carets are NOT present when disabled
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
This adds a configuration option to disable source code previews in
error stack traces via bunfig.toml:
[runtime]
sourceCodePreview = false
When disabled, error stack traces will still show file paths and line
numbers, but will not include the source code snippets with line
numbers and caret indicators that are normally displayed.
Changes:
- Add source_code_preview field to RuntimeOptions in cli.zig
- Add parsing for [runtime].sourceCodePreview in bunfig.zig
- Add source_code_preview field to VirtualMachine struct and Options
- Wire up the config to disable collectSourceLines() in remapZigException
- Add test verifying source code preview can be disabled
Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>