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