|
|
|
|
|
by civilitty
1108 days ago
|
|
An easy way to correct this is injecting a watchdog function call at the end of every for and while loop. It’s a trivial AST transformation that’s relatively fool proof as opposed to trying to figure out what condition would progress the loop. The semantics of the watchdog depend on the use case and ideally you can transform the evaled code in an async wrapper. Set a global variable to the current time on animation frames and then throw an exception inside the watchdog when it times out (when difference between the global variable and current time is > x ms). |
|