Refactor: Modernize Array.prototype.slice.call() to Array.from() - #3373
Draft
TomA-R wants to merge 1 commit into
Draft
Refactor: Modernize Array.prototype.slice.call() to Array.from()#3373TomA-R wants to merge 1 commit into
TomA-R wants to merge 1 commit into
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Modernizes array conversion pattern from pre-ES6 to ES6 syntax.
Changes
Benefits
Testing
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()withArray.from()when converting NodeLists andwindow.framesto arrays inset-unique-element-id.ts,hosted-field.ts, andhosted-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.