nodejs / nodejs/node

Regression Node 24.0.0+: parsing JSONL with U+2028 (line separator)/ U+2029 (paragraph separator)

Aperta
#60,606 9 commenti 4 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

readline repl
Lingua principale
JavaScript
Stelle
122k
Fork
37.3k
Merge medio
4g 2h
PR unite (30g)
283

Descrizione

Version

node v24.0.0+

What steps will reproduce the bug?
  • Open a Node.js shell session (version 24.x or later).
  • Run JSON.parse('{"text":"Hello
World"}') (The character between “Hello” and “World” is U+2028 (line separator). You can also use U+2029 (paragraph separator) instead.)

which will return with a Uncaught SyntaxError: Unexpected token ...

How often does it reproduce? Is there a required condition?

Always

What is the expected behavior? Why is that the expected behavior?
Summary

Note: V8's "Subsume JSON" documentation explicitly discusses making these code points processable in JavaScript string literals (https://v8.dev/features/subsume-json). Given that, this change is surprising and breaks existing production pipelines.

What do you see instead?

After upgrading to Node v24.x, JSON.parse() now throws a SyntaxError when parsing JSON text that contains literal U+2028 (line separator) or U+2029 (paragraph separator) inside a string value. The same input parsed successfully on Node v23.x. This looks like a regression or at least an undocumented behaviour change in Node/V8.

Guida per i contributori

Apri la guida per i contributori

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.

Direzione di ricerca

Inizia riproducendo l’esempio di JSON.parse su Node v24 e confrontalo con Node v23, concentrandoti sul percorso di parsing di JSON e sulla gestione dei letterali U+2028 e U+2029 all’interno delle stringhe. L’issue non menziona file sorgente o test, quindi traccia il punto di ingresso rilevante del runtime o di V8 e aggiungi una copertura che dimostri che l’input viene analizzato correttamente senza modificare altri comportamenti di JSON.

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

Valutazione

Stack tecnologico
javascript, nodejs
Ambito
backend
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Tranquilla
Chiarezza
Abbastanza chiara
Idoneità per principianti
45/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.