aboutsummaryrefslogtreecommitdiffstats
path: root/test/unit/event.js
diff options
context:
space:
mode:
authorAndrew Plummer <plummer.andrew@gmail.com>2013-01-31 12:01:34 -0600
committerCorey Frang <gnarf@gnarf.net>2013-01-31 12:01:34 -0600
commitf005af54e4983658e3ae504111885921c4dca383 (patch)
treedde4b1312d6c477d3a1d043ef96d237e54e5937e /test/unit/event.js
parentd79bf3517eda9b74883c68c255e82067449d3274 (diff)
downloadjquery-f005af54e4983658e3ae504111885921c4dca383.tar.gz
jquery-f005af54e4983658e3ae504111885921c4dca383.zip
event: Stricter type checking in trigger - Fixes #13360 - Closes gh-1153
Squashed commit of the following: commit 5935a362c75ecef04d5ec9775cbcaf2165921e8d Author: Andrew Plummer <plummer.andrew@gmail.com> Date: Fri Feb 1 02:40:42 2013 +0900 Using "hasOwnProperty" to check for direct properties "type" and "namespace" on events before triggering.
Diffstat (limited to 'test/unit/event.js')
-rw-r--r--test/unit/event.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/unit/event.js b/test/unit/event.js
index b252a4654..c3239f902 100644
--- a/test/unit/event.js
+++ b/test/unit/event.js
@@ -2674,3 +2674,17 @@ test( "Check order of focusin/focusout events", 2, function() {
input.off();
});
+test( "String.prototype.namespace does not cause trigger() to throw (#13360)", function() {
+ expect( 1 );
+ var errored = false;
+
+ String.prototype.namespace = function() {};
+
+ try {
+ jQuery("<p>").trigger("foo.bar");
+ } catch( e ) {
+ errored = true;
+ }
+ equal( errored, false, "trigger() did not throw exception" );
+ delete String.prototype.namespace;
+});