Fixes gh-3139
Closes gh-3140
// Create target properties
// Support: Safari <=6 - 7 only
// Target should not be a text node (#504, #13143)
- this.target = ( src.target.nodeType === 3 ) ?
+ this.target = ( src.target && src.target.nodeType === 3 ) ?
src.target.parentNode :
src.target;
}
} );
+QUnit.test( "jQuery.Event( src ) does not require a target property", function( assert ) {
+ assert.expect( 2 );
+
+ var event = jQuery.Event( { type: "offtarget" } );
+
+ assert.equal( event.type, "offtarget", "correct type" );
+ assert.equal( event.target, undefined, "no target" );
+} );
+
QUnit.test( "preventDefault() on focusin does not throw exception", function( assert ) {
assert.expect( 1 );