Skip to content

Commit

Permalink
Fix more Nashorn problems
Browse files Browse the repository at this point in the history
  • Loading branch information
AprilArcus committed Sep 28, 2022
1 parent 44fe613 commit 2226659
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions packages/core-js/internals/function-uncurry-this.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,12 @@ var call = FunctionPrototype.call;
var uncurryThis = NATIVE_BIND && bind.bind(call, call);

module.exports = function (fn) {
var isNativeFunction = fn instanceof Function;
// Nashorn bug, https://github.com/zloirock/core-js/issues/1128
return fn && (NATIVE_BIND && fn instanceof Function ? uncurryThis(fn) : function () {
return call.apply(fn, arguments);
});
if (!isNativeFunction) return;
return NATIVE_BIND
? uncurryThis(fn)
: function () {
return call.apply(fn, arguments);
};
};

0 comments on commit 2226659

Please sign in to comment.