ArrayBuffer does not honor an own byteLength property

Aperta
#3,826 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
66/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
csharp, typescript
Ambito
backend, compilers

Direzione di ricerca

Start by tracing how SharpTS handles Object.defineProperty and the ArrayBuffer.byteLength getter in interpreter mode; the payload does not name source files or tests. Run the provided repro with sharpts --no-tsconfig --noLib repro.js and compare it with the standalone compile and verify commands. Done means the interpreter honors an own byteLength getter and prints custom, matching Node.js.

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

Descrizione

While checking #3819, I found that an own property cannot shadow the built-in ArrayBuffer.byteLength getter.

const value = new ArrayBuffer(4);
Object.defineProperty(value, 'byteLength', { get() { return 'custom'; } });
console.log(value.byteLength);

Node.js v22.23.2 prints custom. SharpTS interpretation rejects Object.defineProperty with TypeError: Object.defineProperty called on non-object. IL-verified standalone executes and prints 4.

Run as sharpts --no-tsconfig --noLib repro.js. For standalone, run sharpts --no-tsconfig --noLib --compile repro.js --standalone --verify -o repro.dll and dotnet repro.dll.

Lingua principale
C#
Stelle
156
Fork
4
Merge medio
14h 45m
PR unite (30g)
40

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.