aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOleg Gaidarenko <markelog@gmail.com>2015-04-30 20:05:18 +0300
committerOleg Gaidarenko <markelog@gmail.com>2015-05-03 13:28:27 +0300
commitfac67a984268ef8f7de952666fda6d8d32754f5f (patch)
treed17027c7ab7e93c895de7d50a7134c48be269c10
parent225bde37c997f5ddd9fe00fdfb8e9a43545cfbbc (diff)
downloadjquery-fac67a984268ef8f7de952666fda6d8d32754f5f.tar.gz
jquery-fac67a984268ef8f7de952666fda6d8d32754f5f.zip
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
-rw-r--r--src/event.js2
-rw-r--r--test/unit/event.js14
2 files changed, 0 insertions, 16 deletions
diff --git a/src/event.js b/src/event.js
index 42bace43d..ee0af6179 100644
--- a/src/event.js
+++ b/src/event.js
@@ -819,8 +819,6 @@ jQuery.fn.extend({
}
if ( fn === false ) {
fn = returnFalse;
- } else if ( !fn ) {
- return this;
}
if ( one === 1 ) {
diff --git a/test/unit/event.js b/test/unit/event.js
index fef9e05fb..95f6f4b33 100644
--- a/test/unit/event.js
+++ b/test/unit/event.js
@@ -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);