Skip to content

Commit

Permalink
Make addEventListener throw for service worker optimization
Browse files Browse the repository at this point in the history
To optimize the service worker execution behavior, this change makes
addEventListener throw when it is called after the very first
evaluation of the service worker script.
  • Loading branch information
jungkees committed Feb 2, 2016
1 parent 07e9fc0 commit ec6dd94
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions dom.bs
Original file line number Diff line number Diff line change
Expand Up @@ -1065,6 +1065,15 @@ seen from the definition above, an <a>event listener</a> is a more broad concept
method, when invoked, must run these steps:

<ol>
<li>
<p>If the global object is a {{ServiceWorkerGlobalScope}} object and its associated
<a>service worker</a>'s <a>has ever been evaluated flag</a> is set, <a>throw</a> an
{{InvalidStateError}} exception. [[!SW]]

<p class="note no-backref">To optimize the service worker execution behavior, the user agent
throws an {{InvalidStateError}} exception when the method is called after the very first
evaluation of the service worker script.

<li><p>If <var>callback</var> is null, terminate these steps.

<li><p>Let <var>capture</var> and <var>passive</var> be the result of <a>flattening</a>
Expand Down

0 comments on commit ec6dd94

Please sign in to comment.