Skip to content

Cancel/Interrupt active evaluation #3442

@mattsse

Description

@mattsse

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-APIChanges related to public APIsA-EnhancementNew feature or request

    Type

    No type

    Projects

    Status

    To do

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions