aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/event.js1
-rw-r--r--test/unit/event.js4
2 files changed, 4 insertions, 1 deletions
diff --git a/src/event.js b/src/event.js
index 6183f703d..7cf14c5c9 100644
--- a/src/event.js
+++ b/src/event.js
@@ -672,6 +672,7 @@ jQuery.Event = function( src, props ) {
// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
jQuery.Event.prototype = {
+ constructor: jQuery.Event,
isDefaultPrevented: returnFalse,
isPropagationStopped: returnFalse,
isImmediatePropagationStopped: returnFalse,
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" );