I am not exactly sure what do you mean by "interrupt" in this case.. But I will give it a shot with my answer:
You can either return a value from your C++ function early on (return v8::False()
) to skip execution of other code inside the same function or throw a JavaScript exception with v8::ThrowException(...)
.
And you can use the v8::V8::TerminateExecution()
. This will terminate the execution in current isolate/thread. The way v8 does that is by throwing an uncatchable exception (in JavaScript land). You can still use the v8::TryCatch
to handle the termination from your C++ code.