From 3cc496ceecdbd76b6c556e85b12696f7c4c09dd5 Mon Sep 17 00:00:00 2001 From: Oleg Gaidarenko Date: Fri, 13 Nov 2015 15:22:36 +0300 Subject: [PATCH] Revert "Event: remove guard for falsy handler argument of jQuery#on method" This reverts commit fac67a984268ef8f7de952666fda6d8d32754f5f. --- src/event.js | 3 ++- test/unit/event.js | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/event.js b/src/event.js index ddd92c5fc..280581249 100644 --- a/src/event.js +++ b/src/event.js @@ -70,6 +70,8 @@ function on( elem, types, selector, data, fn, one ) { } if ( fn === false ) { fn = returnFalse; + } else if ( !fn ) { + return this; } if ( one === 1 ) { @@ -654,7 +656,6 @@ jQuery.each( { } ); jQuery.fn.extend( { - on: function( types, selector, data, fn ) { return on( this, types, selector, data, fn ); }, diff --git a/test/unit/event.js b/test/unit/event.js index cdebbb4e7..b207441c9 100644 --- a/test/unit/event.js +++ b/test/unit/event.js @@ -6,7 +6,6 @@ QUnit.module( "event", { } ); QUnit.test( "on() with non-null,defined data", function( assert ) { - assert.expect( 2 ); var handler = function( event, data ) { -- 2.39.5