mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-28 06:53:42 +08:00
TypedArray.of(...items) on the numeric typed-array constructors creates a new array of its arguments. Each argument converts with ToNumber and then to the element type, in argument order after all arguments are evaluated, as in Node. Arguments that are all numbers copy directly; other values and spreads collect into an array that goes through TypedArray.from's conversion. Spreading a dynamic iterable into a call's items (Array.of, push, TypedArray.of) now drains it through the iterator protocol with the spread call's TypeErrors, and a typed iterable spread into dynamic items boxes and drains the same way. Before, both reached a run-time SC2020. Fixes #1440 Co-authored-by: saboursepideh <25549001+saboursepideh@users.noreply.github.com>