Skip to content

Conversation

bnoordhuis
Copy link
Contributor

Bug introduced in commit 4c32c53 from late last month.

When unwinding the stack, call build_backtrace only when the exception object doesn't already have a .stack property, like how it was before commit 4c32c53.

Fixes: #904

Bug introduced in commit 4c32c53 from late last month. When unwinding the stack, call build_backtrace only when the exception object doesn't already have a .stack property, like how it was before commit 4c32c53. Fixes: quickjs-ng#904
Error.prepareStackTrace = function() { calls++ }
function f() { f() }
assertThrows(RangeError, f)
assert(calls, 0)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The fact the number of calls is zero instead of one is currently more or less by accident but in the case of stack overflow that's the desired behavior IMO (no JS calls) and I have an upcoming pull request that makes that intentional.

@bnoordhuis bnoordhuis merged commit 55db71e into quickjs-ng:master Feb 10, 2025
59 checks passed
@bnoordhuis bnoordhuis deleted the fix904 branch February 10, 2025 22:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants