Skip to content

Commit 9f25c2a

Browse files
committed
removing bound constructor function fallback tests
1 parent ef3164f commit 9f25c2a

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

test/functions.js

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,7 @@
2727
func = function(salutation, firstname, lastname) { return salutation + ': ' + firstname + ' ' + lastname; };
2828
func = _.bind(func, this, 'hello', 'moe', 'curly');
2929
equal(func(), 'hello: moe curly', 'the function was partially applied in advance and can accept multiple arguments');
30-
31-
// These tests are only meaningful when using a browser without a native bind function
32-
// To test this with a modern browser, set underscore's nativeBind to undefined
33-
var F = function () { return this; };
34-
var boundf = _.bind(F, {hello: 'moe curly'});
35-
var Boundf = boundf; // make eslint happy.
36-
var newBoundf = new Boundf();
37-
equal(newBoundf.hello, 'moe curly', 'function should not be bound to the context, because this ain\'t ECMA5');
38-
equal(boundf().hello, 'moe curly', "When called without the new operator, it's OK to be bound to the context");
39-
ok(!(newBoundf instanceof F), 'a bound instance is not an instance of the original function');
40-
30+
4131
throws(function() { _.bind('notafunction'); }, TypeError, 'throws an error when binding to a non-function');
4232
});
4333

0 commit comments

Comments
 (0)