Revert "Event: remove guard for falsy handler argument of jQuery#on method"

This reverts commit fac67a9842.
This commit is contained in:
Timmy Willison 2016-01-07 14:03:04 -05:00
parent fea7da7ea2
commit 0ee94bcb9d

View File

@ -5,6 +5,21 @@ QUnit.module( "event", {
teardown: moduleTeardown 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 ) { QUnit.test( "on() with non-null,defined data", function( assert ) {
assert.expect( 2 ); assert.expect( 2 );