You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • 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

About

Avatar for Gordon @Gordon started