-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
some stylistic changes, improve a note
- Loading branch information
Showing
2 changed files
with
6 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,16 @@ | ||
var NATIVE_BIND = require('../internals/function-bind-native'); | ||
|
||
var FunctionPrototype = Function.prototype; | ||
var $Function = Function; | ||
var FunctionPrototype = $Function.prototype; | ||
var bind = FunctionPrototype.bind; | ||
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 | ||
// https://github.com/zloirock/core-js/issues/1130 | ||
if (!isNativeFunction) return; | ||
return NATIVE_BIND | ||
? uncurryThis(fn) | ||
: function () { | ||
return call.apply(fn, arguments); | ||
}; | ||
return fn instanceof $Function ? NATIVE_BIND ? uncurryThis(fn) : function () { | ||
return call.apply(fn, arguments); | ||
} : undefined; | ||
}; |