aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorDave Methvin <dave.methvin@gmail.com>2011-09-29 10:34:40 -0400
committerDave Methvin <dave.methvin@gmail.com>2011-09-29 10:34:55 -0400
commit96a44a86d870f2634c82a4148d22d0a07044ba77 (patch)
tree2041eb6638782d085290676fe764af5fb50c4f75 /test
parent22fcc7744daded0dc0783d85df3bd88c6dbc4544 (diff)
downloadjquery-96a44a86d870f2634c82a4148d22d0a07044ba77.tar.gz
jquery-96a44a86d870f2634c82a4148d22d0a07044ba77.zip
Fix #10375. Don't put `type` in jQuery.event.props
It's already set in jQuery.Event, and copying it can clobber values set by the caller, e.g., the UI widget factory.
Diffstat (limited to 'test')
-rw-r--r--test/unit/event.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/test/unit/event.js b/test/unit/event.js
index e68d53a76..632254353 100644
--- a/test/unit/event.js
+++ b/test/unit/event.js
@@ -1101,7 +1101,7 @@ test("trigger(eventObject, [data], [fn])", function() {
test("jQuery.Event( type, props )", function() {
- expect(4);
+ expect(5);
var event = jQuery.Event( "keydown", { keyCode: 64 }),
handler = function( event ) {
@@ -1111,6 +1111,9 @@ test("jQuery.Event( type, props )", function() {
// Supports jQuery.Event implementation
equal( event.type, "keydown", "Verify type" );
+
+ // ensure "type" in props won't clobber the one set by constructor
+ equal( jQuery.inArray("type", jQuery.event.props), -1, "'type' property not in props (#10375)" );
ok( "keyCode" in event, "Special 'keyCode' property exists" );