Avoid broken Function#bind in Narwhal.

This commit is contained in:
John-David Dalton
2013-10-24 22:28:45 -07:00
parent 91e779a52c
commit fdbe4c5bd5
8 changed files with 161 additions and 116 deletions

View File

@@ -1228,8 +1228,9 @@
test('should return the function provided if already bound with `Function#bind`', 1, function() {
function a() {}
if (Function.prototype.bind) {
var bound = a.bind();
var bound = a.bind && a.bind({});
if (bound && !bound.prototype) {
var bound = a.bind({});
strictEqual(_.createCallback(bound, {}), bound);
}
else {
@@ -1254,7 +1255,7 @@
function a() {};
var b = function() {};
if (_.support.funcNames || _.support.funcDecomp) {
if (defineProperty && _.support.funcDecomp) {
_.createCallback(a, {});
ok('__bindData__' in a)