I'm afraid you can't increase the stack without rebuilding the firmware to decrease the amount of JsVars available. Which board are you running on?
The interpreter is recursive-descent, so it does use up a bunch of stack for each function call. About 10 levels deep does sound about right. There are few ways around having so many stacked calls though:
use on/emit to send out events if you don't need a response
use Promises
add setTimeout(...,0) when to call a function - if you could do this halfway up your call stack you'd effectively split it in two
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
I'm afraid you can't increase the stack without rebuilding the firmware to decrease the amount of JsVars available. Which board are you running on?
The interpreter is recursive-descent, so it does use up a bunch of stack for each function call. About 10 levels deep does sound about right. There are few ways around having so many stacked calls though:
on
/emit
to send out events if you don't need a responsesetTimeout(...,0)
when to call a function - if you could do this halfway up your call stack you'd effectively split it in two