Skip to content
Permalink
Browse files

Simplify the definition of the "entry" concept

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 36d771a0c90c3534fe0d4c6a23ca240979b94dfd
Showing with 8 additions and 14 deletions.
  1. +8 −14 source
22 source

<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>
<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>

<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
Jellybean Stonerfish,
Jens Bannmann,
Jens Fendler,
Jens Lindstr&ouml;m,
Jens Oliver Meiert,
Jens Widell,
Jer Noble,
Jeremey Hustman,
Jeremy Keith,

0 comments on commit 36d771a

Please sign in to comment.
You can’t perform that action at this time.