Skip to content

Commit 3172ef6

Browse files
authored
Merge pull request #1131 from AprilArcus/april/1130
2 parents 44fe613 + 8bd8508 commit 3172ef6

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

packages/core-js/internals/function-uncurry-this.js

+10-4
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,14 @@ var call = FunctionPrototype.call;
66
var uncurryThis = NATIVE_BIND && bind.bind(call, call);
77

88
module.exports = function (fn) {
9-
// Nashorn bug, https://github.com/zloirock/core-js/issues/1128
10-
return fn && (NATIVE_BIND && fn instanceof Function ? uncurryThis(fn) : function () {
11-
return call.apply(fn, arguments);
12-
});
9+
var isNativeFunction = fn instanceof Function;
10+
// Nashorn bug:
11+
// https://github.com/zloirock/core-js/issues/1128
12+
// https://github.com/zloirock/core-js/issues/1130
13+
if (!isNativeFunction) return;
14+
return NATIVE_BIND
15+
? uncurryThis(fn)
16+
: function () {
17+
return call.apply(fn, arguments);
18+
};
1319
};

0 commit comments

Comments
 (0)