aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorDaniel Herman <daniel.c.herman@gmail.com>2014-05-15 12:26:20 -0400
committerRichard Gibson <richard.gibson@gmail.com>2014-09-04 03:29:16 -0400
commitd4a998f62fde4b9347b99571a7d000b53731909a (patch)
treec8f2bebfff5c51aef93309bed6f4df77cb042281 /test
parent787ffbf5fa9a1afb5883edc576e954337b069bb6 (diff)
downloadjquery-d4a998f62fde4b9347b99571a7d000b53731909a.tar.gz
jquery-d4a998f62fde4b9347b99571a7d000b53731909a.zip
Event: Restore the `constructor` property on jQuery.Event prototype
The original definition of the jQuery.Event prototype was paving over the `constructor` property which was causing jQuery.isPlainObject to improperly report that an instance of jQuery.Event was a plain object. Fixes #15090 Closes gh-1580 (cherry picked from commit b807aedb7fee321fb3aa5d156a5a256ab0634e2d)
Diffstat (limited to 'test')
-rw-r--r--test/unit/event.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/test/unit/event.js b/test/unit/event.js
index 8bb168a40..fb3b75abc 100644
--- a/test/unit/event.js
+++ b/test/unit/event.js
@@ -1511,7 +1511,7 @@ if ( window.onbeforeunload === null &&
test("jQuery.Event( type, props )", function() {
- expect(5);
+ expect(6);
var event = jQuery.Event( "keydown", { keyCode: 64 }),
handler = function( event ) {
@@ -1527,6 +1527,8 @@ test("jQuery.Event( type, props )", function() {
ok( "keyCode" in event, "Special 'keyCode' property exists" );
+ strictEqual( jQuery.isPlainObject( event ), false, "Instances of $.Event should not be identified as a plain object." );
+
jQuery("body").on( "keydown", handler ).trigger( event );
jQuery("body").off( "keydown" );