Compiled require(node:buffer) exposes non-callable isUtf8, isAscii, transcode and SlowBuffer

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

Direzione di ricerca

Start by tracing how CommonJS exports for node:buffer are represented in the standalone compiler output, then compare those exports with the interpreter results shown in the issue. Reproduce with the provided repro.js using sharpts --no-tsconfig --noLib --compile repro.js --standalone --verify -o repro.dll and run dotnet repro.dll. Done when all four exports are callable in the compiled standalone output, matching the interpreter and Node.js.

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

Descrizione

While verifying #3824, I found four other node:buffer helpers that compile to non-callable exports through CommonJS.

const buffer = require('node:buffer');
console.log(typeof buffer.isUtf8, typeof buffer.isAscii, typeof buffer.transcode, typeof buffer.SlowBuffer);

Node.js v22.23.2 and SharpTS interpretation print function function function function. SharpTS IL-verified standalone prints object object object object.

Reproduced on 7f342ac7c. Run sharpts --no-tsconfig --noLib repro.js, or build with sharpts --no-tsconfig --noLib --compile repro.js --standalone --verify -o repro.dll and run 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.