Skip to content

Commit

Permalink
refactor(polyfills): do not raise a Assignment call unless needed. (#242
Browse files Browse the repository at this point in the history
)

* Update polyfills.ts

Signed-off-by: Reaper Gelera <[email protected]>

* chore: style fix

---------

Signed-off-by: Reaper Gelera <[email protected]>
  • Loading branch information
barelyhuman authored Apr 12, 2024
1 parent d8244c2 commit c84ef8a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/polyfills.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,7 @@ const ArrayConstructors = [
];

ArrayConstructors.forEach((ArrayConstructor) => {
ArrayConstructor.prototype.at = ArrayConstructor.prototype.at ?? at;
if (!Object.prototype.hasOwnProperty.call(ArrayConstructor, 'at')) {
ArrayConstructor.prototype.at = at;
}
});

0 comments on commit c84ef8a

Please sign in to comment.