Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

WeakMap subclasses: wrong prototype for default subclasses; super()/new.target receivers miss the WeakMap brand

Aperta
#12,396 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à
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
rust
Ambito
compilers

Direzione di ricerca

Read the class construction and builtin subclass branding paths in class_registry and construct dispatch, then reproduce the failure with the WeakMap subclass/new.target fixture described in secret-tests/scratchpad/codex-q/qsbirths-REPORT.md. Compare the results with the stated Node behavior, including Reflect.construct(WeakMap, [], X); done means default subclasses have the expected prototype and instances support WeakMap set/get, including explicit super() and new.target construction.

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

Descrizione

Subclassing WeakMap doesn't match node. It fails on main (72a44412a) and with the qsbirths candidate alike.

  • A default subclass (class X extends WeakMap {}) gets the wrong prototype.
  • Explicit super() / new.target construction can leave a subclass receiver without the WeakMap brand, so x.get(k) then throws.

Repro: the WeakMap subclass/new.target fixture retained in qb6 /root/claude-lanes/qsbirths, described in secret-tests/scratchpad/codex-q/qsbirths-REPORT.md ("Verification"). Expected: node's behaviour, where new X() instanceof X && instanceof WeakMap, Object.getPrototypeOf(new X()) === X.prototype, and set/get work on subclass instances, including with Reflect.construct(WeakMap, [], X).

The cause is in class construction / builtin-subclass branding (class_registry and construct dispatch), not in WeakMap storage. Likely the same for WeakSet.

Lingua principale
Rust
Stelle
4.9k
Fork
166
Merge medio
1h 20m
PR unite (30g)
915

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 PerryTS/perry

Tutte le issue di PerryTS/perry

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.