You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Avoid executing the code in the All Fetch Listeners Are Empty algorithm. (#1676)
* Avoid executing the code in the All Fetch Listeners Are Empty algorithm.
* Removed redundant check.
* Add a note that clarify that we ignores handleEvent.
* Updated the note as suggested.
1. If |eventHandler| is not null and |eventListenerCallback| equals |eventHandler|'s [=event handler/listener=]'s [=event listener/callback=], then set |callback| to the result of [=convert to an ECMAScript value|converting to an ECMAScript value=] |eventHandler|'s [=event handler/value=].
3011
3011
1. Otherwise, set |callback| to the result of [=convert to an ECMAScript value|converting to an ECMAScript value=] |eventListenerCallback|.
3012
-
1. If [$IsCallable$](|callback|) is false:
3013
-
1. Let |getResult| be [=Completion=]([$Get$](|callback|), <code>handleEvent</code>).
3014
-
1. If |getResult| is [=abrupt completion=], then return false.
3015
-
1. Set |callback| to |getResult|.
3016
-
1. If [$IsCallable$](|callback|) is false, or |callback|'s [=function body=] is not empty (i.e. either a [=statement=] or [=declaration=] exist), then return false.
3012
+
1. If [$IsCallable$](|callback|) is false, then return false.
3013
+
3014
+
Note: [=Event listener/Callback=] objects that use {{handleEvent}} are assumed to be non-empty. This avoids calling the {{handleEvent}} getters, which could modify the event listeners during this check.
3015
+
3016
+
1. If |callback|'s [=function body=] is not empty (i.e. either a [=statement=] or [=declaration=] exist), then return false.
3017
3017
3018
3018
Note: This detects "<code>fetch</code>" listeners like `() => {}`. Some sites have a fetch event listener with empty body to make them recognized by Chromium as a progressive web application (PWA).
0 commit comments