Add trigger InterruptHandler support

Open
#387 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 5 days

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
30/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
c, javascript
Domain
compilers

Research direction

Start by reading the JS_Call path and the JSInterruptHandler behavior in QuickJS, focusing on how interrupt state is checked during script execution. Determine whether an exported JS_TriggerInterruptHandler API can safely affect a running JSContext, and define the expected behavior for large scripts before proposing an implementation.

Written by the indexing model from the issue text.

Description

QuickJS is great! but it cannot set pause after JS_Call, maybe should export a new JS_TriggerInterruptHandler API , then the C program can trigger the JSContext running state through a special JSInterruptHandler, it's very useful when executing a large scripts.Would this be feasible?

void JS_TriggerInterruptHandler(JSContext *ctx)
{
   ctx->interrupt_counter = 0;
}
Dominant language
C
Stars
11.1k
Forks
1.2k
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from bellard/quickjs

All issues in bellard/quickjs

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.