Skip to content

Fix #797: Iterate over brands as an array#798

Merged
faisalman merged 1 commit into
faisalman:masterfrom
anulman:aidan/fix-brands-iteration
Aug 1, 2025
Merged

Fix #797: Iterate over brands as an array#798
faisalman merged 1 commit into
faisalman:masterfrom
anulman:aidan/fix-brands-iteration

Conversation

@anulman

@anulman anulman commented Jul 17, 2025

Copy link
Copy Markdown
Contributor

Prerequisites

Type of Change

Bug fix

Description

I observed script failures on sites that mangle the Array.prototype and opened #797. This PR changes two instances where for...in loops were including prototype methods of arrays vs. the items they enumerate.

Test

I first ran the script manually on a site that mangled the Array.prototype with an isEmpty method. When this worked, I came to contribute. See the provided test for something that used to fail and now succeeds.

Impact

If users previously relied on setProps passing non-owned properties to the result, this would be a breaking change.

Since that seems like unexpected behaviour, that's probably more of a bugfix though :)

@anulman
anulman force-pushed the aidan/fix-brands-iteration branch from 7ea14f8 to d78e8bc Compare July 17, 2025 21:09
@faisalman
faisalman merged commit ecbc033 into faisalman:master Aug 1, 2025
6 checks passed
@anulman
anulman deleted the aidan/fix-brands-iteration branch August 4, 2025 18:47
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.

2 participants