#3442·boa

Cancel/Interrupt active evaluation

Author: mattsseCreated Oct 30, 2023Updated Aug 10, 2026
LabelsA-EnhancementA-API

feature I would like to be able to cancel an evaluation (or JsValue::call) after a certain timeout. Perhaps this is already possible, but I wasn't able to find it.

boja for example has interrupts:

https://github.com/dop251/goja/blob/b396bb4c349df65109dea3df00fb60f6a044950d/runtime.go#L1474C9-L1482

my motivation for this is to have the option to terminate a (malicious) evaluation for example while(1) {}

Example code Give a code example that should work after the implementation of this feature.