mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-29 07:04:09 +08:00
A binding that may hold a value its declared type omits (a function parameter fed array elements, which can be holes) and that the checker narrowed to one record or class arm of a union with more than two arms was read through a checked extraction of that arm. When the binding held a hole, a member read or method call threw "undefined is not representable in the target union ..." for a record arm and "Value is not an instance of 'Shape'" for a class arm, where Node throws "Cannot read properties of undefined (reading 'a')". The read now tests for undefined first and throws Node's TypeError, as the two-arm path already does.