mirror of
https://github.com/jquery/jquery.git
synced 2024-11-23 02:54:22 +00:00
Event: remove guard for falsy handler argument of jQuery#on method
(cherry-picked from fac67a9842
)
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:
parent
fb25bacf9b
commit
1a067a49d1
@ -1002,8 +1002,6 @@ jQuery.fn.extend({
|
|||||||
}
|
}
|
||||||
if ( fn === false ) {
|
if ( fn === false ) {
|
||||||
fn = returnFalse;
|
fn = returnFalse;
|
||||||
} else if ( !fn ) {
|
|
||||||
return this;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( one === 1 ) {
|
if ( one === 1 ) {
|
||||||
|
@ -5,20 +5,6 @@ module( "event", {
|
|||||||
teardown: moduleTeardown
|
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() {
|
test("on() with non-null,defined data", function() {
|
||||||
|
|
||||||
expect(2);
|
expect(2);
|
||||||
|
Loading…
Reference in New Issue
Block a user