diff options
author | Daniel Herman <daniel.c.herman@gmail.com> | 2014-05-15 12:26:20 -0400 |
---|---|---|
committer | Richard Gibson <richard.gibson@gmail.com> | 2014-09-04 03:28:40 -0400 |
commit | b807aedb7fee321fb3aa5d156a5a256ab0634e2d (patch) | |
tree | 91268d79b8e4c868c4de20acfbf7408939486ccd /test | |
parent | 1ae025e24f9920d18cec8a8498bfc4eed7e3f1dc (diff) | |
download | jquery-b807aedb7fee321fb3aa5d156a5a256ab0634e2d.tar.gz jquery-b807aedb7fee321fb3aa5d156a5a256ab0634e2d.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
Diffstat (limited to 'test')
-rw-r--r-- | test/unit/event.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/test/unit/event.js b/test/unit/event.js index 67fe9115b..fe0f0c2da 100644 --- a/test/unit/event.js +++ b/test/unit/event.js @@ -1442,7 +1442,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 ) { @@ -1458,6 +1458,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" ); |