]> source.dussan.org Git - jquery.git/commitdiff
Event: Simplify the check for saved data in leverageNative
authorMichał Gołębiowski-Owczarek <m.goleb@gmail.com>
Mon, 3 Apr 2023 16:21:15 +0000 (18:21 +0200)
committerGitHub <noreply@github.com>
Mon, 3 Apr 2023 16:21:15 +0000 (18:21 +0200)
Previously, when `leverageNative` handled async events, there was
a case where an empty placeholder object was set as a result.
Covering both such an object and `false` required a `length` check.
However, this is not necessary since gh-5223 and the check was
already simplified in other places; this one was missed.

Closes gh-5236
Ref gh-5223

src/event.js

index c9a397c90bfc74c1938f9e20a0a90b72f73ef448..7c9e1d546bda7a688483d95e82e7c1d6a5c7bac8 100644 (file)
@@ -556,7 +556,7 @@ function leverageNative( el, type, isSetup ) {
 
                        // If this is a native event triggered above, everything is now in order
                        // Fire an inner synthetic event with the original arguments
-                       } else if ( saved.length ) {
+                       } else if ( saved ) {
 
                                // ...and capture the result
                                dataPriv.set( this, type, jQuery.event.trigger(