Compiled Buffer bracket reads try to convert method names into integers

Aperta
#3,893 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
72/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
csharp, typescript
Ambito
backend, compilers

Direzione di ricerca

Start at the compiled Buffer branch of $Runtime.GetIndex and trace how it handles string keys versus numeric byte indexes. Compare the compiled behavior with ordinary property access and the interpreter behavior shown in the example. Done means b['includes'] resolves to a function in compiled execution while numeric indexing still works; the issue names no test file, so locate or add coverage for both cases.

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

Descrizione

Found while verifying #3885. The compiled Buffer branch of $Runtime.GetIndex always converts its key to an integer, including names that work through ordinary property access.

function inspect(b) { console.log(typeof b['includes']); }
inspect(Buffer.of(65));

Node.js v22.23.2 and SharpTS interpretation print function. Compiled execution throws a CLR System.FormatException for the string includes. Named keys should use the same property lookup as dot access, alongside numeric byte indexing.

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.