Skip to content

Commit fac67a9

Browse files
committed
Event: remove guard for falsy handler argument of jQuery#on method
Since we don't have this in off method and its a common perception that this is a rudiment code Ref jquerygh-2248 Closes jquerygh-2249
1 parent 225bde3 commit fac67a9

File tree

2 files changed

+0
-16
lines changed

2 files changed

+0
-16
lines changed

src/event.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -819,8 +819,6 @@ jQuery.fn.extend({
819819
}
820820
if ( fn === false ) {
821821
fn = returnFalse;
822-
} else if ( !fn ) {
823-
return this;
824822
}
825823

826824
if ( one === 1 ) {

test/unit/event.js

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

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

2410
expect(2);

0 commit comments

Comments
 (0)