`{ ..."ab" }` is `{}`; a throw in a `for await` body does not wait for the iterator's return()
I maintainer di solito rispondono entro 5 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 35/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- c, javascript
Direzione di ricerca
Start by reading the object spread path and JS_CopyDataProperties, then trace how the source is converted before its properties are copied. For the for await case, follow AsyncIteratorClose and its handling of throw completions. Use the two reproductions in the issue to check both behaviors; done means string properties are copied and iterator cleanup finishes before the catch runs.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
1. Object spread of a string primitive copies nothing.
console.log(JSON.stringify({ ..."ab" })); // {"0":"a","1":"b"}
console.log(JSON.stringify({ ...new String("ab") })); // {"0":"a","1":"b"}
./qjs t.js prints {} for the first line; the second is correct, and so are Object.assign({}, "ab") and const {...r} = "ab". JS_CopyDataProperties returns early when the source is not an object, and the object-literal spread path doesn't convert the source with ToObject first.
2. A throw in a for await body doesn't await return().
const log = [];
async function* g() { try { yield 1; } finally { log.push("finally"); } }
(async () => {
try { for await (const v of g()) throw "t"; } catch (e) { log.push("catch"); }
console.log(log.join(" ")); // expected: finally catch
})();
Actual: catch (the finally runs later). With break instead of throw master is correct; the 2026-06-04 release gets both wrong. AsyncIteratorClose awaits the result of return() even when the completion is a throw.
Versions: master e5ac135 (2026-11-09) and release 2026-06-04, Linux x86-64.
Credit: https://ucsbplse.github.io/
- Lingua principale
- C
- Stelle
- 11.1k
- Fork
- 1.2k
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
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
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di bellard/quickjs
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 75/100
I maintainer di solito rispondono entro 5 giorni
-
RegExp: patterns with more than 255 capture groups fail with "too many captures"Forse già presa @andreasrosdal l’ha presa 3 giorni fa. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
bellard/quickjs#624 · 1 commento ·
I maintainer di solito rispondono entro 5 giorni
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
bellard/quickjs#620 · 1 commento ·
I maintainer di solito rispondono entro 5 giorni
-
(comment on #611) `function g(a, d = (a = 10)) { return a; }` returns the argument instead of 10Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 30/100
I maintainer di solito rispondono entro 5 giorni
-
Account for Map/Set retained strings in JS_ComputeMemoryUsage, or document partial accountingAperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 30/100
I maintainer di solito rispondono entro 5 giorni
Tutte le issue di bellard/quickjs
Issue simili
-
Fix a typo in H5Centry.cAperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
FujiNetWIFI/fujinet-firmware#2518 ·
I maintainer di solito rispondono entro 1 giorno
-
[mimalloc] update to 3.7.1Apertacategory:port-update
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
I maintainer di solito rispondono entro 2 giorni
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
lauppv/cyberstars#610 ·
I maintainer di solito rispondono entro 1 giorno
-
documentation good first issue help wanted
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100