Skip to content

Commit

Permalink
Define hack for open() to deal with undefined and omitted being diffe…
Browse files Browse the repository at this point in the history
  • Loading branch information
annevk committed Nov 1, 2013
1 parent 7c4b8cb commit 76a4c65
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
15 changes: 12 additions & 3 deletions Overview.html
Expand Up @@ -7,7 +7,7 @@

<p><a class="logo" href="//www.whatwg.org/"><img alt="WHATWG" height="100" src="//resources.whatwg.org/logo-xhr.svg" width="100"></a>
<h1 class="head" id="xmlhttprequest-ls">XMLHttpRequest</h1>
<h2 class="no-num no-toc" id="living-standard-—-last-updated-31-october-2013">Living Standard — Last Updated 31 October 2013</h2>
<h2 class="no-num no-toc" id="living-standard-—-last-updated-1-november-2013">Living Standard — Last Updated 1 November 2013</h2>

<dl>
<dt>This Version:
Expand Down Expand Up @@ -36,7 +36,7 @@ <h2 class="no-num no-toc" id="living-standard-—-last-updated-31-october-2013">
<p class="copyright"><a href="http://creativecommons.org/publicdomain/zero/1.0/" rel="license"><img alt="CC0" src="http://i.creativecommons.org/p/zero/1.0/80x15.png"></a>
To the extent possible under law, the editor has waived all copyright and
related or neighboring rights to this work. In addition, as of
31 October 2013, the editor has made this specification available
1 November 2013, the editor has made this specification available
under the
<a href="http://www.openwebfoundation.org/legal/the-owf-1-0-agreements/owfa-1-0" rel="license">Open Web Foundation Agreement Version 1.0</a>,
which is available at
Expand Down Expand Up @@ -279,7 +279,8 @@ <h2 id="interface-xmlhttprequest"><span class="secno">4 </span>Interface <code t
readonly attribute unsigned short <a href="#dom-xmlhttprequest-readystate" title="dom-XMLHttpRequest-readyState">readyState</a>;

// <a href="#request">request</a>
void <a href="#dom-xmlhttprequest-open" title="dom-XMLHttpRequest-open">open</a>(ByteString <var>method</var>, [EnsureUTF16] DOMString <var title="">url</var>, optional boolean <var>async</var> = true, optional [EnsureUTF16] DOMString? <var>username</var> = null, optional [EnsureUTF16] DOMString? <var>password</var> = null);
void <a href="#dom-xmlhttprequest-open" title="dom-XMLHttpRequest-open">open</a>(ByteString <var>method</var>, [EnsureUTF16] DOMString <var title="">url</var>);
void <a href="#dom-xmlhttprequest-open" title="dom-XMLHttpRequest-open">open</a>(ByteString <var>method</var>, [EnsureUTF16] DOMString <var title="">url</var>, boolean <var>async</var>, optional [EnsureUTF16] DOMString? <var>username</var> = null, optional [EnsureUTF16] DOMString? <var>password</var> = null);
void <a href="#dom-xmlhttprequest-setrequestheader" title="dom-XMLHttpRequest-setRequestHeader">setRequestHeader</a>(ByteString <var>name</var>, ByteString <var>value</var>);
attribute unsigned long <a href="#dom-xmlhttprequest-timeout" title="dom-XMLHttpRequest-timeout">timeout</a>;
attribute boolean <a href="#dom-xmlhttprequest-withcredentials" title="dom-XMLHttpRequest-withCredentials">withCredentials</a>;
Expand Down Expand Up @@ -622,6 +623,14 @@ <h4 id="the-open()-method"><span class="secno">4.5.1 </span>The <code title="">o
<a class="external" href="http://dom.spec.whatwg.org/#concept-throw" title="concept-throw">throw</a> a
"<code class="external"><a href="http://dom.spec.whatwg.org/#syntaxerror">SyntaxError</a></code>" exception.

<li>
<p>If the <var>async</var> argument is omitted, set <var>async</var> to true, and set
<var title="">username</var> and <var title="">password</var> to null.

<p class="note">Due to unfortunate legacy constraints, passing
<code title="">undefined</code> for the <var>async</var> argument is treated differently
from <var>async</var> being omitted.

<li>
<p>If <var title="">parsed URL</var>'s <a class="external" href="http://url.spec.whatwg.org/#relative-flag">relative flag</a> is
set, run these substeps:
Expand Down
11 changes: 10 additions & 1 deletion Overview.src.html
Expand Up @@ -234,7 +234,8 @@ <h2>Interface <code title>XMLHttpRequest</code></h2>
readonly attribute unsigned short <span title="dom-XMLHttpRequest-readyState">readyState</span>;

// <a href="#request">request</a>
void <span title="dom-XMLHttpRequest-open">open</span>(ByteString <var>method</var>, [EnsureUTF16] DOMString <var title>url</var>, optional boolean <var>async</var> = true, optional [EnsureUTF16] DOMString? <var>username</var> = null, optional [EnsureUTF16] DOMString? <var>password</var> = null);
void <span title="dom-XMLHttpRequest-open">open</span>(ByteString <var>method</var>, [EnsureUTF16] DOMString <var title>url</var>);
void <span title="dom-XMLHttpRequest-open">open</span>(ByteString <var>method</var>, [EnsureUTF16] DOMString <var title>url</var>, boolean <var>async</var>, optional [EnsureUTF16] DOMString? <var>username</var> = null, optional [EnsureUTF16] DOMString? <var>password</var> = null);
void <span title="dom-XMLHttpRequest-setRequestHeader">setRequestHeader</span>(ByteString <var>name</var>, ByteString <var>value</var>);
attribute unsigned long <span title="dom-XMLHttpRequest-timeout">timeout</span>;
attribute boolean <span title="dom-XMLHttpRequest-withCredentials">withCredentials</span>;
Expand Down Expand Up @@ -577,6 +578,14 @@ <h4>The <code title>open()</code> method</h4>
<span data-anolis-spec=dom title=concept-throw>throw</span> a
"<code data-anolis-spec=dom>SyntaxError</code>" exception.

<li>
<p>If the <var>async</var> argument is omitted, set <var>async</var> to true, and set
<var title>username</var> and <var title>password</var> to null.

<p class=note>Due to unfortunate legacy constraints, passing
<code title>undefined</code> for the <var>async</var> argument is treated differently
from <var>async</var> being omitted.

<li>
<p>If <var title>parsed URL</var>'s <span data-anolis-spec=url>relative flag</span> is
set, run these substeps:
Expand Down

0 comments on commit 76a4c65

Please sign in to comment.