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 8bd8508
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions packages/core-js/internals/function-uncurry-this.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,14 @@ var call = FunctionPrototype.call;
var uncurryThis = NATIVE_BIND && bind.bind(call, call);

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

0 comments on commit 8bd8508

Please sign in to comment.