Skip to content

Commit 0ee94bc

Browse files
committed
Revert "Event: remove guard for falsy handler argument of jQuery#on method"
This reverts commit fac67a9.
1 parent fea7da7 commit 0ee94bc

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

test/unit/event.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,21 @@ QUnit.module( "event", {
55
teardown: moduleTeardown
66
} );
77

8+
QUnit.test( "null or undefined handler", function( assert ) {
9+
assert.expect( 2 );
10+
11+
// Supports Fixes bug #7229
12+
try {
13+
jQuery( "#firstp" ).on( "click", null );
14+
ok( true, "Passing a null handler will not throw an exception" );
15+
} catch ( e ) {}
16+
17+
try {
18+
jQuery( "#firstp" ).on( "click", undefined );
19+
ok( true, "Passing an undefined handler will not throw an exception" );
20+
} catch ( e ) {}
21+
} );
22+
823
QUnit.test( "on() with non-null,defined data", function( assert ) {
924
assert.expect( 2 );
1025

0 commit comments

Comments
 (0)