We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Function.prototype.bind
1 parent 9559d88 commit 00f4a2bCopy full SHA for 00f4a2b
test/unit/function_test.js
@@ -33,9 +33,10 @@ new Test.Unit.Runner({
33
function methodWithoutArguments() { return this.hi };
34
function methodWithArguments() { return this.hi + ',' + $A(arguments).join(',') };
35
var func = Prototype.emptyFunction;
36
+
37
+ // We used to test that `bind` without a `context` argument simply
38
+ // returns the original function, but this contradicts the ES5 spec.
39
- this.assertIdentical(func, func.bind());
- this.assertIdentical(func, func.bind(undefined));
40
this.assertNotIdentical(func, func.bind(null));
41
42
this.assertEqual('without', methodWithoutArguments.bind({ hi: 'without' })());
0 commit comments