mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-11-02 07:43:42 +08:00
An Array subclass's type maps to its element array type, so a field such as TreeNode.kids holds a Kids instance in a slot typed as an array of TreeNode. The collector visits such a slot as an array, which has a collector header when its element ops trace, but the class only got a header when its own class unit was on a cycle, and the collector read a header the instance did not have. An Array subclass now carries a header whenever an array of its element type does, and its collector descriptor visits its elements instead of naming no children. An element read of an array of Array subclass instances is a union with undefined, and 'instanceof' against the class answered false for it. A union now tests its array arms' class at run time.