Found while fixing #10624 (PR #10640) and confirmed unrelated to instanceof — filing separately so it is not
lost in that PR's body.
Shape: a two-level ClassExprFresh chain, where an inherited method closes over a captured local, returns
undefined instead of the captured value.
This is capture forwarding through a dynamically-evaluated class chain, not a prototype or instanceof question.
Likely neighbours — check these first
If this turns out to be the remaining half of #10486 rather than a distinct defect, say so on both issues and
close whichever is the duplicate.
Found while fixing #10624 (PR #10640) and confirmed unrelated to
instanceof— filing separately so it is notlost in that PR's body.
Shape: a two-level
ClassExprFreshchain, where an inherited method closes over a captured local, returnsundefinedinstead of the captured value.This is capture forwarding through a dynamically-evaluated class chain, not a prototype or
instanceofquestion.Likely neighbours — check these first
Part of #10486) — forwards inherited captures through a locally-shadowed class parent, andexplicitly does not close Inherited method of a capture-bearing class expression sees
undefinedcaptures when called on an instance of a capture-bearingclass extendssubclass without a constructor #10486: a subclass with an empty body, or one whose base is a class declaration,still fails, because
codegen/mod.rs's packed-fieldparent_chainwalk keys offClass.extends_namewhich thatfix deliberately doesn't write back. A two-level chain is exactly the shape that walk gets wrong.
Fixes #10485/#10489) — replaced theLet-counting heuristic inshared_mutable_capture.rswitha
DeclCensus, because avaris declared twice and so never satisfied "exactly one declaration".If this turns out to be the remaining half of #10486 rather than a distinct defect, say so on both issues and
close whichever is the duplicate.