mirror of
https://github.com/jquery/jquery.git
synced 2026-02-01 05:05:02 -05:00
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 gh-2248 Closes gh-2249
This commit is contained in:
@@ -819,8 +819,6 @@ jQuery.fn.extend({
|
||||
}
|
||||
if ( fn === false ) {
|
||||
fn = returnFalse;
|
||||
} else if ( !fn ) {
|
||||
return this;
|
||||
}
|
||||
|
||||
if ( one === 1 ) {
|
||||
|
||||
@@ -5,20 +5,6 @@ module( "event", {
|
||||
teardown: moduleTeardown
|
||||
});
|
||||
|
||||
test("null or undefined handler", function() {
|
||||
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 ) {}
|
||||
});
|
||||
|
||||
test("on() with non-null,defined data", function() {
|
||||
|
||||
expect(2);
|
||||
|
||||
Reference in New Issue
Block a user