Commit Graph

3 Commits

Author SHA1 Message Date
Claude Bot
66ecf9802a test: verify console.log is not in stderr (source code preview)
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>
2025-10-16 03:58:25 +00:00
Claude Bot
a665db4549 test: improve source code preview test to verify console.log not in output
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>
2025-10-16 03:55:41 +00:00
Claude Bot
ab1d20e596 Add bunfig.toml [runtime] sourceCodePreview option
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>
2025-10-16 03:50:56 +00:00