8000
Skip to content

Refactor: Modernize Array.prototype.slice.call() to Array.from() - #3373

Draft
TomA-R wants to merge 1 commit into
masterfrom
fix/modernize-array-conversion
Draft

Refactor: Modernize Array.prototype.slice.call() to Array.from()#3373
TomA-R wants to merge 1 commit into
masterfrom
fix/modernize-array-conversion

Conversation

@TomA-R
@TomA-R TomA-R commented Aug 24, 2026
Copy link
Copy Markdown
Member

Summary

Modernizes array conversion pattern from pre-ES6 to ES6 syntax.

Changes

  • Replace Array.prototype.slice.call() with Array.from() in 3 files:
    • set-unique-element-id.ts
    • hosted-input-aggregator.ts
    • hosted-field.ts

Benefits

  • Clearer intent of what the code is doing
  • More concise and modern ES6 syntax
  • Better readability

Testing

  • Build passes with NX
  • No breaking changes to API

Note

Low Risk
Cosmetic syntax change with no API or control-flow updates. Slight IE11 concern if Array.from is not polyfilled, but the rest of the code already uses Array.from.

Overview
Replaces Array.prototype.slice.call() with Array.from() when converting NodeLists and window.frames to arrays in set-unique-element-id.ts, hosted-field.ts, and hosted-input-aggregator.ts. Behavior is unchanged; this is a readability/ES6 syntax cleanup.

Reviewed by Cursor Bugbot for commit 39dece7. Bugbot is set up for automated code reviews on this repo. Configure here.

Modernize array conversion pattern across three files:
- set-unique-element-id.ts
- hosted-input-aggregator.ts
- hosted-field.ts

Array.from() is clearer intent and more concise than the pre-ES6 pattern.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

0