Files
scriptc/packages/runtime
Chris Tate 3cafa64fe7 Follow the specification's reads and writes for array-like receivers
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.
2026-10-29 14:30:44 -05:00
..
2026-07-22 18:08:04 -05:00
2026-10-25 11:26:13 -05:00