- Notifications
You must be signed in to change notification settings - Fork 204
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
function f() { f() } let count = 0 Error.prepareStackTrace = () => count++ try { f() } catch (e) { // ignore } print(count) // prints ~157, increases with bigger --stack-size
It's due to the build_backtrace call in JS_CallInternal that's called every time a stack frame is unwound.
Another way of demonstrating the issue:
function f(n) { if (--n > 0) f(n) else throw Error("unwind") } Error.prepareStackTrace = (exc, stk) => print(stk.length) try { f(16) } catch (e) { // ignore }
Prints:
10 10 10 10 10 10 10 10 10 9 8 7 6 5 4 3 2 1
saghul and past-due
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working