Skip to content

Commit c84ef8a

Browse files
authored
refactor(polyfills): do not raise a Assignment call unless needed. (#242)
* Update polyfills.ts Signed-off-by: Reaper Gelera <ahoy@barelyhuman.dev> * chore: style fix --------- Signed-off-by: Reaper Gelera <ahoy@barelyhuman.dev>
1 parent d8244c2 commit c84ef8a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/polyfills.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,5 +46,7 @@ const ArrayConstructors = [
4646
];
4747

4848
ArrayConstructors.forEach((ArrayConstructor) => {
49-
ArrayConstructor.prototype.at = ArrayConstructor.prototype.at ?? at;
49+
if (!Object.prototype.hasOwnProperty.call(ArrayConstructor, 'at')) {
50+
ArrayConstructor.prototype.at = at;
51+
}
5052
});

0 commit comments

Comments
 (0)