Skip to content

Commit

Permalink
[Refactor] avoid call-binding entirely when there is no method to bind
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Oct 20, 2023
1 parent c166569 commit 9ff452b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion index.js
Expand Up @@ -40,7 +40,10 @@ if (hasToStringTag && gOPD && getPrototypeOf) {
} else {
forEach(typedArrays, function (typedArray) {
var arr = new g[typedArray]();
cache['$' + typedArray] = callBind(arr.slice || arr.set);
var fn = arr.slice || arr.set;
if (fn) {
cache['$' + typedArray] = callBind(fn);
}
});
}

Expand Down

0 comments on commit 9ff452b

Please sign in to comment.