Skip to content

fix(core): don't panic in to_v8_error when JS error builder callback fails#32749

Merged
bartlomieju merged 2 commits intodenoland:mainfrom
bartlomieju:fix/to-v8-error-panic
Mar 17, 2026
Merged

fix(core): don't panic in to_v8_error when JS error builder callback fails#32749
bartlomieju merged 2 commits intodenoland:mainfrom
bartlomieju:fix/to-v8-error-panic

Conversation

@bartlomieju
Copy link
Copy Markdown
Member

@bartlomieju bartlomieju commented Mar 15, 2026

Summary

  • When the JS error builder callback in to_v8_error throws (e.g. due to stack overflow or Object.prototype / Array.prototype pollution), fall back to returning the plain message string instead of panicking
  • Adds a unit test for the stack overflow case

Closes #28436
Closes #29824
Closes #27720

Test plan

🤖 Generated with Claude Code

bartlomieju and others added 2 commits March 15, 2026 15:17
…fails

When the JS error builder callback throws (e.g. due to stack overflow or
Array.prototype pollution), fall back to returning the plain message string
instead of panicking. This handles cases where the V8 call stack is exhausted
and the callback itself can't execute.

Closes denoland#28436
Closes denoland#29824

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Member

@littledivy littledivy left a comment

Choose a reason for hiding this comment

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

LGTM

@bartlomieju bartlomieju merged commit 974c6da into denoland:main Mar 17, 2026
112 checks passed
@bartlomieju bartlomieju deleted the fix/to-v8-error-panic branch March 17, 2026 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants