mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-09 02:17:50 +00:00
Cleanup _.bind.
Former-commit-id: d974cdfa52c3f6c175e57f0970380bcc9276c35d
This commit is contained in:
@@ -1712,12 +1712,8 @@
|
|||||||
else if (nativeBind) {
|
else if (nativeBind) {
|
||||||
return nativeBind.call.apply(nativeBind, arguments);
|
return nativeBind.call.apply(nativeBind, arguments);
|
||||||
}
|
}
|
||||||
// spec'd to throw a TypeError
|
// `Function#bind` spec
|
||||||
// http://es5.github.com/#x15.3.4.5
|
// http://es5.github.com/#x15.3.4.5
|
||||||
else if (toString.call(func) != funcClass) {
|
|
||||||
throw new TypeError;
|
|
||||||
}
|
|
||||||
|
|
||||||
var partialArgs = slice.call(arguments, 2),
|
var partialArgs = slice.call(arguments, 2),
|
||||||
partialArgsLength = partialArgs.length;
|
partialArgsLength = partialArgs.length;
|
||||||
|
|
||||||
@@ -1746,7 +1742,7 @@
|
|||||||
partialArgs.length = partialArgsLength;
|
partialArgs.length = partialArgsLength;
|
||||||
|
|
||||||
if (isInstance) {
|
if (isInstance) {
|
||||||
// mimic a constructor's `return` behavior
|
// mimic the constructor's `return` behavior
|
||||||
// http://es5.github.com/#x13.2.2
|
// http://es5.github.com/#x13.2.2
|
||||||
return objectTypes[typeof result] && result !== null
|
return objectTypes[typeof result] && result !== null
|
||||||
? result
|
? result
|
||||||
|
|||||||
Reference in New Issue
Block a user