Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

RFC: removal of JSRuntime

Aperta
#421 9 commenti 11 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 3 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
20/100
Tipo di issue
Refactoring
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
c
Ambito
compilers

Direzione di ricerca

No files or tests are named. Start by mapping the JSRuntime and JSContext declarations, their lifecycle functions, and all APIs with an RT suffix; then review how a current realm could be represented. Done would require an agreed API design, consistent implementation across the engine, and a defined backward-compatibility strategy.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

The existence of JSRuntime and JSContext complicates the QuickJS API because many functions are duplicated and sometimes it is not clear whether a JSRuntime or JSContext parameter is required. The rationale is that JSContext represent the JS Realm and JSRuntime the whole JS execution content. In many applications, having more than one Realm is not needed. Even when several realms are needed, it should be enough to have a current realm stored in the execution context and an API to change it.

So I propose to remove the JSRuntime type and to add a new JSRealm type. JSContext would become the JS execution context. New functions would be added to change the current realm and to create or destroy a realm. All the functions with a RT suffix would be removed.

If necessary, backward compatibility could be mostly kept by setting JSRuntime = JSContext and by redirecting the functions with a RT suffix to the corresponding functions without a RT suffix.

Lingua principale
C
Stelle
11.1k
Fork
1.2k
Merge medio
11h 20m
PR unite (30g)
1

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di bellard/quickjs

Tutte le issue di bellard/quickjs

Issue simili

Altre issue su C

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.