From 0ee94bcb9d49acb0706921b1ab4b13883b1fdd7f Mon Sep 17 00:00:00 2001 From: Timmy Willison Date: Thu, 7 Jan 2016 14:03:04 -0500 Subject: Revert "Event: remove guard for falsy handler argument of jQuery#on method" This reverts commit fac67a984268ef8f7de952666fda6d8d32754f5f. --- test/unit/event.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/test/unit/event.js b/test/unit/event.js index 804ece2ca..b574efc7e 100644 --- a/test/unit/event.js +++ b/test/unit/event.js @@ -5,6 +5,21 @@ QUnit.module( "event", { teardown: moduleTeardown } ); +QUnit.test( "null or undefined handler", function( assert ) { + assert.expect( 2 ); + + // Supports Fixes bug #7229 + try { + jQuery( "#firstp" ).on( "click", null ); + ok( true, "Passing a null handler will not throw an exception" ); + } catch ( e ) {} + + try { + jQuery( "#firstp" ).on( "click", undefined ); + ok( true, "Passing an undefined handler will not throw an exception" ); + } catch ( e ) {} +} ); + QUnit.test( "on() with non-null,defined data", function( assert ) { assert.expect( 2 ); -- cgit v1.2.3