Open ydewit opened 12 years ago
Considering this can also be done by the javascript developer in sections with long running code, where would be the appropriate place for the engine to insert all of these checks that are not part of the script being executed? After every statement or expression evaluation?
This is a good use case for the "observer count" functionality in the Context class, which lets you get your arbitrary code called every N bytecode instructions. It only works with compiled code (opt level >= 0), however. But it lets you do this without any changes to Rhino.
Added the docs
label, so once we have our new documentation in place, we can add some info to the docs about the observer count functionality
This will enable Rhino to play nice with ThreadPoolExecutor when the client calls Future.cancel(true);