Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Remove exception throwing to allow a resolver to race.

  • Loading branch information...
commit aadbcfa92a311f701aaeab12356f40e29fde0195 1 parent e3d62d1
@annevk annevk authored
Showing with 95 additions and 146 deletions.
  1. +60 −97 Overview.src.html
  2. +35 −49 dom-core.html
View
157 Overview.src.html
@@ -705,68 +705,6 @@ <h2 class=no-num>Goals</h2>
<span title=concept-resolver>resolver</span>'s <span>resolved flag</span> is unset.
<p>A <span title=concept-resolver>resolver</span>'s
-<dfn title=concept-resolver-accept>accept</dfn> algorithm takes a <var title>value</var>
-and optionally a <i title>synchronous flag</i>, and runs these steps:
-
-<ol>
- <li><p>If the <span>resolved flag</span> is set, terminate these steps.
- can never happen -->
-
- <li><p>Let <var title>future</var> be its associated
- <span title=concept-future>future</span>.
-
- <li><p>Set <var title>future</var>'s <span title=concept-future-state>state</span> to
- <i title>accepted</i>.
-
- <li><p>Set <var title>future</var>'s <span title=concept-future-result>result</span> to
- <var title>value</var>.
-
- <li><p>If the <i title>synchronous flag</i> is set,
- <span title=concept-future-process>process</span> <var title>future</var>'s
- <span title=concept-future-accept-handlers>accept handlers</span> with
- <var title>value</var>.
-
- <li><p>Otherwise, the <i title>synchronous flag</i> is unset,
- <span data-anolis-spec=html>queue a task</span> to
- <span title=concept-future-process>process</span> <var title>future</var>'s
- <span title=concept-future-accept-handlers>accept handlers</span> with
- <var title>value</var>.
-
- <li><p>Set the <span>resolved flag</span>.
-</ol>
-
-<p>A <span title=concept-resolver>resolver</span>'s
-<dfn title=concept-resolver-reject>reject</dfn> algorithm takes a <var title>value</var>
-and optionally a <i title>synchronous flag</i>, and runs these steps:
-
-<ol>
- <li><p>If the <span>resolved flag</span> is set, terminate these steps.
- <!-- can happen via anonymous callbacks -->
-
- <li><p>Let <var title>future</var> be its associated
- <span title=concept-future>future</span>.
-
- <li><p>Set <var title>future</var>'s <span title=concept-future-state>state</span> to
- <i title>rejected</i>.
-
- <li><p>Set <var title>future</var>'s <span title=concept-future-result>result</span> to
- <var title>value</var>.
-
- <li><p>If the <i title>synchronous flag</i> is set,
- <span title=concept-future-process>process</span> <var title>future</var>'s
- <span title=concept-future-reject-handlers>reject handlers</span> with
- <var title>value</var>.
-
- <li><p>Otherwise, the <i title>synchronous flag</i> is unset,
- <span data-anolis-spec=html>queue a task</span> to
- <span title=concept-future-process>process</span> <var title>future</var>'s
- <span title=concept-future-reject-handlers>reject handlers</span> with
- <var title>value</var>.
-
- <li><p>Set the <span>resolved flag</span>.
-</ol>
-
-<p>A <span title=concept-resolver>resolver</span>'s
<dfn title=concept-resolver-resolve>resolve</dfn> algorithm takes a <var title>value</var>
and optionally a <i title>synchronous flag</i>, and runs these steps:
@@ -811,11 +749,12 @@ <h2 class=no-num>Goals</h2>
<i title>synchronous flag</i> if set, and then terminate these steps.
<li>
- <p>If JavaScript IsCallable <var title>then</var>, then run these substeps:
+ <p>If JavaScript IsCallable <var title>then</var>, run these substeps and then terminate
+ these steps:
<ol>
<li><p>Let <var title>accept</var> be a JavaScript <code title>Function</code> Object
- which when called invokes <span title=concept-resolver-accept>accept</span> with the
+ which when called invokes <span title=concept-resolver-resolve>resolve</span> with the
first argument passed and with <code title>undefined</code> if no arguments are passed.
<li><p>Let <var title>reject</var> be a JavaScript <code title>Function</code> Object
@@ -831,8 +770,58 @@ <h2 class=no-num>Goals</h2>
<i title>synchronous flag</i> if set.
</ol>
- <li><p>Otherwise, run <span title=concept-resolver-accept>accept</span> with
- <var title>value</var> and the <i title>synchronous flag</i> if set.
+ <li><p>Let <var title>future</var> be the <span>context object</span>'s associated
+ <span title=concept-future>future</span>.
+
+ <li><p>Set <var title>future</var>'s <span title=concept-future-state>state</span> to
+ <i title>accepted</i>.
+
+ <li><p>Set <var title>future</var>'s <span title=concept-future-result>result</span> to
+ <var title>value</var>.
+
+ <li><p>Set the <span>resolved flag</span>.
+
+ <li><p>If the <i title>synchronous flag</i> is set,
+ <span title=concept-future-process>process</span> <var title>future</var>'s
+ <span title=concept-future-accept-handlers>accept handlers</span> with
+ <var title>value</var>.
+
+ <li><p>Otherwise, the <i title>synchronous flag</i> is unset,
+ <span data-anolis-spec=html>queue a task</span> to
+ <span title=concept-future-process>process</span> <var title>future</var>'s
+ <span title=concept-future-accept-handlers>accept handlers</span> with
+ <var title>value</var>.
+</ol>
+
+<p>A <span title=concept-resolver>resolver</span>'s
+<dfn title=concept-resolver-reject>reject</dfn> algorithm takes a <var title>value</var>
+and optionally a <i title>synchronous flag</i>, and runs these steps:
+
+<ol>
+ <li><p>If the <span>resolved flag</span> is set, terminate these steps.
+ <!-- can happen via anonymous callbacks -->
+
+ <li><p>Let <var title>future</var> be its associated
+ <span title=concept-future>future</span>.
+
+ <li><p>Set <var title>future</var>'s <span title=concept-future-state>state</span> to
+ <i title>rejected</i>.
+
+ <li><p>Set <var title>future</var>'s <span title=concept-future-result>result</span> to
+ <var title>value</var>.
+
+ <li><p>Set the <span>resolved flag</span>.
+
+ <li><p>If the <i title>synchronous flag</i> is set,
+ <span title=concept-future-process>process</span> <var title>future</var>'s
+ <span title=concept-future-reject-handlers>reject handlers</span> with
+ <var title>value</var>.
+
+ <li><p>Otherwise, the <i title>synchronous flag</i> is unset,
+ <span data-anolis-spec=html>queue a task</span> to
+ <span title=concept-future-process>process</span> <var title>future</var>'s
+ <span title=concept-future-reject-handlers>reject handlers</span> with
+ <var title>value</var>.
</ol>
<p>Unless stated otherwise, the <span data-anolis-spec=html>task source</span> used by
@@ -844,9 +833,8 @@ <h2 class=no-num>Goals</h2>
<h3>Futures API</h3>
<pre class=idl>interface <dfn>FutureResolver</dfn> {
- void <span title=dom-FutureResolver-accept>accept</span>(optional any <var title>value</var>);
void <span title=dom-FutureResolver-resolve>resolve</span>(optional any <var title>value</var>);
- void <span title=dom-FutureResolver-reject>reject</span>(optional any <var title>error</var>);
+ void <span title=dom-FutureResolver-reject>reject</span>(optional any <var title>value</var>);
readonly attribute boolean <span title=dom-FutureResolver-isResolved>isResolved</span>;
};
@@ -863,38 +851,13 @@ <h2 class=no-num>Goals</h2>
<p>A <code>FutureResolver</code> object is a <span title=concept-resolver>resolver</span>.
-<p>The <dfn title=dom-FutureResolver-accept><code>accept(<var>value</var>)</code></dfn>
-method must run these steps:
-
-<ol>
- <li><p>If the <span>context object</span>'s <span>resolved flag</span> is set, throw an
- "<code title>AlreadyResolved</code>" exception.
-
- <li><p>Run <span>context object</span>'s
- <span title=concept-resolver-accept>accept</span> with <var title>value</var>.
-</ol>
-
<p>The <dfn title=dom-FutureResolver-resolve><code>resolve(<var>value</var>)</code></dfn>
-method must run these steps:
-
-<ol>
- <li><p>If the <span>context object</span>'s <span>resolved flag</span> is set, throw an
- "<code title>AlreadyResolved</code>" exception.
-
- <li><p>Run <span>context object</span>'s
- <span title=concept-resolver-resolve>resolve</span> with <var title>value</var>.
-</ol>
+method must run <span>context object</span>'s
+<span title=concept-resolver-resolve>resolve</span> with <var title>value</var>.
<p>The <dfn title=dom-FutureResolver-reject><code>reject(<var>value</var>)</code></dfn>
-method must run these steps:
-
-<ol>
- <li><p>If the <span>context object</span>'s <span>resolved flag</span> is set, throw an
- "<code title>AlreadyResolved</code>" exception.
-
- <li><p>Run <span>context object</span>'s
- <span title=concept-resolver-reject>reject</span> with <var title>value</var>.
-</ol>
+method must run <span>context object</span>'s
+<span title=concept-resolver-reject>reject</span> with <var title>value</var>.
<p>The <dfn title=dom-FutureResolver-isResolved><code>isResolved</code></dfn> attribute
must return true if <span>context object</span>'s <span>resolved flag</span> is set and
View
84 dom-core.html
@@ -783,37 +783,6 @@ <h3 id="futures-model"><span class="secno">4.2 </span>Futures Model</h3>
<a href="#concept-resolver" title="concept-resolver">resolver</a>'s <a href="#resolved-flag">resolved flag</a> is unset.
<p>A <a href="#concept-resolver" title="concept-resolver">resolver</a>'s
-<dfn id="concept-resolver-reject" title="concept-resolver-reject">reject</dfn> algorithm takes a <var title="">value</var>
-and optionally a <i title="">synchronous flag</i>, and runs these steps:
-
-<ol>
- <li><p>If the <a href="#resolved-flag">resolved flag</a> is set, terminate these steps.
- <!-- can happen via anonymous callbacks -->
-
- <li><p>Let <var title="">future</var> be its associated
- <a href="#concept-future" title="concept-future">future</a>.
-
- <li><p>Set <var title="">future</var>'s <a href="#concept-future-state" title="concept-future-state">state</a> to
- <i title="">rejected</i>.
-
- <li><p>Set <var title="">future</var>'s <a href="#concept-future-result" title="concept-future-result">result</a> to
- <var title="">value</var>.
-
- <li><p>Set the <a href="#resolved-flag">resolved flag</a>.
-
- <li><p>If the <i title="">synchronous flag</i> is set,
- <a href="#concept-future-process" title="concept-future-process">process</a> <var title="">future</var>'s
- <a href="#concept-future-reject-handlers" title="concept-future-reject-handlers">reject handlers</a> with
- <var title="">value</var>.
-
- <li><p>Otherwise, the <i title="">synchronous flag</i> is unset,
- <a class="external" data-anolis-spec="html" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#queue-a-task">queue a task</a> to
- <a href="#concept-future-process" title="concept-future-process">process</a> <var title="">future</var>'s
- <a href="#concept-future-reject-handlers" title="concept-future-reject-handlers">reject handlers</a> with
- <var title="">value</var>.
-</ol>
-
-<p>A <a href="#concept-resolver" title="concept-resolver">resolver</a>'s
<dfn id="concept-resolver-resolve" title="concept-resolver-resolve">resolve</dfn> algorithm takes a <var title="">value</var>
and optionally a <i title="">synchronous flag</i>, and runs these steps:
@@ -902,6 +871,37 @@ <h3 id="futures-model"><span class="secno">4.2 </span>Futures Model</h3>
<var title="">value</var>.
</ol>
+<p>A <a href="#concept-resolver" title="concept-resolver">resolver</a>'s
+<dfn id="concept-resolver-reject" title="concept-resolver-reject">reject</dfn> algorithm takes a <var title="">value</var>
+and optionally a <i title="">synchronous flag</i>, and runs these steps:
+
+<ol>
+ <li><p>If the <a href="#resolved-flag">resolved flag</a> is set, terminate these steps.
+ <!-- can happen via anonymous callbacks -->
+
+ <li><p>Let <var title="">future</var> be its associated
+ <a href="#concept-future" title="concept-future">future</a>.
+
+ <li><p>Set <var title="">future</var>'s <a href="#concept-future-state" title="concept-future-state">state</a> to
+ <i title="">rejected</i>.
+
+ <li><p>Set <var title="">future</var>'s <a href="#concept-future-result" title="concept-future-result">result</a> to
+ <var title="">value</var>.
+
+ <li><p>Set the <a href="#resolved-flag">resolved flag</a>.
+
+ <li><p>If the <i title="">synchronous flag</i> is set,
+ <a href="#concept-future-process" title="concept-future-process">process</a> <var title="">future</var>'s
+ <a href="#concept-future-reject-handlers" title="concept-future-reject-handlers">reject handlers</a> with
+ <var title="">value</var>.
+
+ <li><p>Otherwise, the <i title="">synchronous flag</i> is unset,
+ <a class="external" data-anolis-spec="html" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#queue-a-task">queue a task</a> to
+ <a href="#concept-future-process" title="concept-future-process">process</a> <var title="">future</var>'s
+ <a href="#concept-future-reject-handlers" title="concept-future-reject-handlers">reject handlers</a> with
+ <var title="">value</var>.
+</ol>
+
<p>Unless stated otherwise, the <a class="external" data-anolis-spec="html" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#task-source">task source</a> used by
<a href="#concept-future" title="concept-future">futures</a> and their
<a href="#concept-resolver" title="concept-resolver">resolvers</a> is the
@@ -930,26 +930,12 @@ <h3 id="futures-api"><span class="secno">4.3 </span>Futures API</h3>
<p>A <code><a href="#futureresolver">FutureResolver</a></code> object is a <a href="#concept-resolver" title="concept-resolver">resolver</a>.
<p>The <dfn id="dom-futureresolver-resolve" title="dom-FutureResolver-resolve"><code>resolve(<var>value</var>)</code></dfn>
-method must run these steps:
-
-<ol>
- <li><p>If the <a href="#context-object">context object</a>'s <a href="#resolved-flag">resolved flag</a> is set, throw an
- "<code title="">AlreadyResolved</code>" exception.
-
- <li><p>Run <a href="#context-object">context object</a>'s
- <a href="#concept-resolver-resolve" title="concept-resolver-resolve">resolve</a> with <var title="">value</var>.
-</ol>
+method must run <a href="#context-object">context object</a>'s
+<a href="#concept-resolver-resolve" title="concept-resolver-resolve">resolve</a> with <var title="">value</var>.
<p>The <dfn id="dom-futureresolver-reject" title="dom-FutureResolver-reject"><code>reject(<var>value</var>)</code></dfn>
-method must run these steps:
-
-<ol>
- <li><p>If the <a href="#context-object">context object</a>'s <a href="#resolved-flag">resolved flag</a> is set, throw an
- "<code title="">AlreadyResolved</code>" exception.
-
- <li><p>Run <a href="#context-object">context object</a>'s
- <a href="#concept-resolver-reject" title="concept-resolver-reject">reject</a> with <var title="">value</var>.
-</ol>
+method must run <a href="#context-object">context object</a>'s
+<a href="#concept-resolver-reject" title="concept-resolver-reject">reject</a> with <var title="">value</var>.
<p>The <dfn id="dom-futureresolver-isresolved" title="dom-FutureResolver-isResolved"><code>isResolved</code></dfn> attribute
must return true if <a href="#context-object">context object</a>'s <a href="#resolved-flag">resolved flag</a> is set and
Please sign in to comment.
Something went wrong with that request. Please try again.