mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-11-10 01:56:15 +08:00
concat read a receiver's length before appending it, flatMap called its callback without thisArg, and with, toReversed, toSorted and toSpliced checked indexes with HasProperty, which a proxy's has trap or a getter observes. Writes to a string receiver were discarded, though a String wrapper's indexes below its length and its length are read-only. - concat appends a receiver that is not an array as its first element without reading `length`; the array dispatch's concat spreads the arguments. - flatMap calls the callback with thisArg as `this`. - with, toReversed, toSorted and toSpliced read every index with Get alone and define it on the result, so a missing index becomes undefined. toReversed reads from the last index down, with never reads the index it replaces, and toSpliced without arguments returns a copy. - On a string receiver, a write to an index below the string's length or to `length` throws "Cannot assign to read only property '<key>' of object '[object String]'", and deleting such an index throws "Cannot delete property '<index>' of [object String]", as in Node. Writes to number, boolean, bigint and symbol receivers are still discarded with their wrapper. - fill, copyWithin and reverse return their receiver, which for a primitive is its wrapper object, and concat's result starts with it. A compiled program has no wrapper objects, so these calls on a primitive throw the "not supported yet" Error. - An array receiver held as an untyped value ran these methods through scr_dyn_array_proto_call, which implements none of them, and threw "not supported yet". It now runs them through the array dispatch.