Skip to content

Commit

Permalink
Simplify the definition of the "entry" concept
Browse files Browse the repository at this point in the history
It turns out that the "entrance counter" concept was unnecessary.
Whenever we run script, we increment it, and whenever we clean up after
running script, we decrement it. So it is always nonzero. Thus we can
simply look for whether it's a realm execution context.

Fixes #2441.
  • Loading branch information
domenic committed Apr 18, 2017
1 parent d5f63d2 commit 36d771a
Showing 1 changed file with 8 additions and 14 deletions.
22 changes: 8 additions & 14 deletions source
Expand Up @@ -87622,9 +87622,6 @@ interface <dfn>NavigatorOnLine</dfn> {

<ol>

<li><p>Increment <var>settings</var>'s <span>realm execution context</span>'s <span>entrance
counter</span> by one.</p></li>

<li><p>Push <var>settings</var>'s <span>realm execution context</span> onto the <span>JavaScript
execution context stack</span>; it is now the <span>running JavaScript execution
context</span>.</p></li>
Expand All @@ -87642,9 +87639,6 @@ interface <dfn>NavigatorOnLine</dfn> {
<li><p>Remove <var>settings</var>'s <span>realm execution context</span> from the
<span>JavaScript execution context stack</span>.</p></li>

<li><p>Decrement <var>settings</var>'s <span>realm execution context</span>'s <span>entrance
counter</span> by one.</p></li>

<li><p>If the <span>JavaScript execution context stack</span> is now empty, <span>perform a
microtask checkpoint</span>. (If this runs scripts, these algorithms will be invoked
reentrantly.)</p></li>
Expand Down Expand Up @@ -87871,15 +87865,15 @@ interface <dfn>NavigatorOnLine</dfn> {

<h6>Entry</h6>

<p>All <span data-x="realm execution context">realm execution contexts</span> must contain, as
part of their code evaluation state, an <dfn>entrance counter</dfn> value, which is initially
zero. In the process of <a href="#calling-scripts">calling scripts</a>, this value will be
incremented and decremented.</p>
<p>The process of <a href="#calling-scripts">calling scripts</a> will push or pop <span
data-x="realm execution context">realm execution contexts</span> onto the <span>JavaScript
execution context stack</span>, interspersed with other <span data-x="JavaScript execution
context">execution contexts</span>.</p>

<p>With this in hand, we define the <dfn>entry execution context</dfn> to be the most recently
pushed entry in the <span>JavaScript execution context stack</span> whose <span>entrance
counter</span> value is greater than zero. The <dfn data-x="concept-entry-realm">entry Realm</dfn>
is the <span>entry execution context</span>'s Realm component.</p>
pushed item in the <span>JavaScript execution context stack</span> that is a <span data-x="realm
execution context">realm execution context</span>. The <dfn data-x="concept-entry-realm">entry
Realm</dfn> is the <span>entry execution context</span>'s Realm component.</p>

<p>Then, the <dfn>entry settings object</dfn> is the <span
data-x="concept-realm-settings-object">environment settings object</span> of the <span
Expand Down Expand Up @@ -120236,8 +120230,8 @@ INSERT INTERFACES HERE
Jellybean Stonerfish,
Jens Bannmann,
Jens Fendler,
Jens Lindstr&ouml;m,
Jens Oliver Meiert,
Jens Widell,
Jer Noble,
Jeremey Hustman,
Jeremy Keith,
Expand Down

0 comments on commit 36d771a

Please sign in to comment.