Buffer.concat ignores a nonnumeric totalLength

Aperta
#3,889 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
62/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
csharp, typescript
Ambito
backend

Direzione di ricerca

Start by tracing SharpTS's implementation of Buffer.concat and how it handles the optional totalLength argument; the issue provides a JavaScript reproduction and Node.js v22.23.2 behavior to compare against. Run the reproduction in SharpTS and its IL-verified standalone, then find the relevant tests or add a regression case. Done when a nonnumeric totalLength produces the same TypeError and ERR_INVALID_ARG_TYPE behavior as Node.js.

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

Descrizione

Found while testing #3884. Run this as JavaScript.

const concat = Buffer.concat;
try { console.log(concat([Buffer.of(65)], '2').toString('hex')); }
catch (e) { console.log(e.name, e.code); }

Node.js v22.23.2 prints TypeError ERR_INVALID_ARG_TYPE. SharpTS interpretation and an IL-verified standalone infer the length and print 41.

Lingua principale
C#
Stelle
156
Fork
4
Merge medio
13h 20m
PR unite (30g)
47

Preparare l'ambiente

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 nickna/SharpTS

Tutte le issue di nickna/SharpTS

Issue simili

Altre issue su C#

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.