Cleanup _.bind.

Former-commit-id: d974cdfa52c3f6c175e57f0970380bcc9276c35d
This commit is contained in:
John-David Dalton
2012-05-24 01:40:24 -04:00
parent b94eb44e18
commit af3ded68c4

View File

@@ -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