hermes icon indicating copy to clipboard operation
hermes copied to clipboard

Implement `TypedArray.prototype.with`

Open robik opened this issue 1 year ago • 7 comments

Summary

This PR implements ES2023 TypedArray.prototype.with method. This is a follow-up of PR #1286 which added with method on standard Array prototype.

See also:

  • PR for TypedArray.prototype.toReversed: #1366
  • PR for TypedArray.prototype.toSorted: #1367

I am creating separate PRs for each method in case there are any suggestions or change requests from your side, so that PRs are more independent.

Test Plan

Code is annotated with algorithm steps from EcmaScript specification for easier verification and maintenance. I also added tests to verify that methods work as intended. There might be some more edge cases that might be covered based on your experience.

$ echo "new Int8Array([0]).with(0, 5)" | ./bin/hermes
# >> Int8Array [ 5 ]

robik avatar Mar 29 '24 15:03 robik

Superseded by #5601.

dependabot[bot] avatar May 06 '24 14:05 dependabot[bot]