diff options
author | Timmy Willison <4timmywil@gmail.com> | 2018-01-08 11:55:14 -0500 |
---|---|---|
committer | Timmy Willison <4timmywil@gmail.com> | 2018-01-08 11:55:14 -0500 |
commit | 50b94f47d2b4b40f7b9181e42e83e848efb4c4c9 (patch) | |
tree | 7ebe6aa0d0f8f5c6f87f8e9eea93057cad7d73d7 /test | |
parent | c9efd11f47c68f0537c8ea535b8d6a9c6d667175 (diff) | |
download | jquery-50b94f47d2b4b40f7b9181e42e83e848efb4c4c9.tar.gz jquery-50b94f47d2b4b40f7b9181e42e83e848efb4c4c9.zip |
Tests: fix function reference for unbinding
Ref gh-2958
Diffstat (limited to 'test')
-rw-r--r-- | test/unit/event.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/test/unit/event.js b/test/unit/event.js index e23c6fd29..5dc17722d 100644 --- a/test/unit/event.js +++ b/test/unit/event.js @@ -687,15 +687,15 @@ QUnit.test( "on(), with different this object", function( assert ) { data = { myData: true }, handler1 = function() { assert.equal( this, thisObject, "on() with different this object" ); - }, + }.bind( thisObject ), handler2 = function( event ) { assert.equal( this, thisObject, "on() with different this object and data" ); assert.equal( event.data, data, "on() with different this object and data" ); - }; + }.bind( thisObject ); jQuery( "#firstp" ) - .on( "click", handler1.bind( thisObject ) ).trigger( "click" ).off( "click", handler1 ) - .on( "click", data, handler2.bind( thisObject ) ).trigger( "click" ).off( "click", handler2 ); + .on( "click", handler1 ).trigger( "click" ).off( "click", handler1 ) + .on( "click", data, handler2 ).trigger( "click" ).off( "click", handler2 ); assert.ok( !jQuery._data( jQuery( "#firstp" )[ 0 ], "events" ), "Event handler unbound when using different this object and data." ); } ); |