1
1
/*!
2
- * jQuery JavaScript Library v3.4.0
2
+ * jQuery JavaScript Library v3.4.1
3
3
* https://jquery.com/
4
4
*
5
5
* Includes Sizzle.js
9
9
* Released under the MIT license
10
10
* https://jquery.org/license
11
11
*
12
- * Date: 2019-04-10T19:48Z
12
+ * Date: 2019-05-01T21:04Z
13
13
*/
14
14
( function ( global , factory ) {
15
15
@@ -142,7 +142,7 @@ function toType( obj ) {
142
142
143
143
144
144
var
145
- version = "3.4.0 " ,
145
+ version = "3.4.1 " ,
146
146
147
147
// Define a local copy of jQuery
148
148
jQuery = function ( selector , context ) {
@@ -4498,8 +4498,12 @@ var documentElement = document.documentElement;
4498
4498
} ,
4499
4499
composed = { composed : true } ;
4500
4500
4501
+ // Support: IE 9 - 11+, Edge 12 - 18+, iOS 10.0 - 10.2 only
4501
4502
// Check attachment across shadow DOM boundaries when possible (gh-3504)
4502
- if ( documentElement . attachShadow ) {
4503
+ // Support: iOS 10.0-10.2 only
4504
+ // Early iOS 10 versions support `attachShadow` but not `getRootNode`,
4505
+ // leading to errors. We need to check for `getRootNode`.
4506
+ if ( documentElement . getRootNode ) {
4503
4507
isAttached = function ( elem ) {
4504
4508
return jQuery . contains ( elem . ownerDocument , elem ) ||
4505
4509
elem . getRootNode ( composed ) === elem . ownerDocument ;
@@ -5359,8 +5363,7 @@ jQuery.event = {
5359
5363
5360
5364
// Claim the first handler
5361
5365
if ( rcheckableType . test ( el . type ) &&
5362
- el . click && nodeName ( el , "input" ) &&
5363
- dataPriv . get ( el , "click" ) === undefined ) {
5366
+ el . click && nodeName ( el , "input" ) ) {
5364
5367
5365
5368
// dataPriv.set( el, "click", ... )
5366
5369
leverageNative ( el , "click" , returnTrue ) ;
@@ -5377,8 +5380,7 @@ jQuery.event = {
5377
5380
5378
5381
// Force setup before triggering a click
5379
5382
if ( rcheckableType . test ( el . type ) &&
5380
- el . click && nodeName ( el , "input" ) &&
5381
- dataPriv . get ( el , "click" ) === undefined ) {
5383
+ el . click && nodeName ( el , "input" ) ) {
5382
5384
5383
5385
leverageNative ( el , "click" ) ;
5384
5386
}
@@ -5419,7 +5421,9 @@ function leverageNative( el, type, expectSync ) {
5419
5421
5420
5422
// Missing expectSync indicates a trigger call, which must force setup through jQuery.event.add
5421
5423
if ( ! expectSync ) {
5422
- jQuery . event . add ( el , type , returnTrue ) ;
5424
+ if ( dataPriv . get ( el , type ) === undefined ) {
5425
+ jQuery . event . add ( el , type , returnTrue ) ;
5426
+ }
5423
5427
return ;
5424
5428
}
5425
5429
@@ -5434,9 +5438,13 @@ function leverageNative( el, type, expectSync ) {
5434
5438
if ( ( event . isTrigger & 1 ) && this [ type ] ) {
5435
5439
5436
5440
// Interrupt processing of the outer synthetic .trigger()ed event
5437
- if ( ! saved ) {
5441
+ // Saved data should be false in such cases, but might be a leftover capture object
5442
+ // from an async native handler (gh-4350)
5443
+ if ( ! saved . length ) {
5438
5444
5439
5445
// Store arguments for use when handling the inner native event
5446
+ // There will always be at least one argument (an event object), so this array
5447
+ // will not be confused with a leftover capture object.
5440
5448
saved = slice . call ( arguments ) ;
5441
5449
dataPriv . set ( this , type , saved ) ;
5442
5450
@@ -5449,14 +5457,14 @@ function leverageNative( el, type, expectSync ) {
5449
5457
if ( saved !== result || notAsync ) {
5450
5458
dataPriv . set ( this , type , false ) ;
5451
5459
} else {
5452
- result = undefined ;
5460
+ result = { } ;
5453
5461
}
5454
5462
if ( saved !== result ) {
5455
5463
5456
5464
// Cancel the outer synthetic event
5457
5465
event . stopImmediatePropagation ( ) ;
5458
5466
event . preventDefault ( ) ;
5459
- return result ;
5467
+ return result . value ;
5460
5468
}
5461
5469
5462
5470
// If this is an inner synthetic event for an event with a bubbling surrogate
@@ -5471,17 +5479,19 @@ function leverageNative( el, type, expectSync ) {
5471
5479
5472
5480
// If this is a native event triggered above, everything is now in order
5473
5481
// Fire an inner synthetic event with the original arguments
5474
- } else if ( saved ) {
5482
+ } else if ( saved . length ) {
5475
5483
5476
5484
// ...and capture the result
5477
- dataPriv . set ( this , type , jQuery . event . trigger (
5478
-
5479
- // Support: IE <=9 - 11+
5480
- // Extend with the prototype to reset the above stopImmediatePropagation()
5481
- jQuery . extend ( saved . shift ( ) , jQuery . Event . prototype ) ,
5482
- saved ,
5483
- this
5484
- ) ) ;
5485
+ dataPriv . set ( this , type , {
5486
+ value : jQuery . event . trigger (
5487
+
5488
+ // Support: IE <=9 - 11+
5489
+ // Extend with the prototype to reset the above stopImmediatePropagation()
5490
+ jQuery . extend ( saved [ 0 ] , jQuery . Event . prototype ) ,
5491
+ saved . slice ( 1 ) ,
5492
+ this
5493
+ )
5494
+ } ) ;
5485
5495
5486
5496
// Abort handling of the native event
5487
5497
event . stopImmediatePropagation ( ) ;
0 commit comments