aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimmy Willison <timmywillisn@gmail.com>2016-01-07 14:03:04 -0500
committerTimmy Willison <timmywillisn@gmail.com>2016-01-07 14:03:04 -0500
commit0ee94bcb9d49acb0706921b1ab4b13883b1fdd7f (patch)
tree8eb75ced86f4f871088a4058862d478a55cb2487
parentfea7da7ea22b754fbf73bfbd2282f8cc66909920 (diff)
downloadjquery-0ee94bcb9d49acb0706921b1ab4b13883b1fdd7f.tar.gz
jquery-0ee94bcb9d49acb0706921b1ab4b13883b1fdd7f.zip
Revert "Event: remove guard for falsy handler argument of jQuery#on method"
This reverts commit fac67a984268ef8f7de952666fda6d8d32754f5f.
-rw-r--r--test/unit/event.js15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/unit/event.js b/test/unit/event.js
index 804ece2ca..b574efc7e 100644
--- a/test/unit/event.js
+++ b/test/unit/event.js
@@ -5,6 +5,21 @@ QUnit.module( "event", {
teardown: moduleTeardown
} );
+QUnit.test( "null or undefined handler", function( assert ) {
+ assert.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 ) {}
+} );
+
QUnit.test( "on() with non-null,defined data", function( assert ) {
assert.expect( 2 );