Skip to content

Commit

Permalink
Use the initial value of JSON.parse https://www.w3.org/Bugs/Public/sh…
Browse files Browse the repository at this point in the history
  • Loading branch information
annevk committed Sep 6, 2013
1 parent 9b57f11 commit 02fff31
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
13 changes: 7 additions & 6 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-3-september-2013">Living Standard — Last Updated 3 September 2013</h2>
<h2 class="no-num no-toc" id="living-standard-—-last-updated-6-september-2013">Living Standard — Last Updated 6 September 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-3-september-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
3 September 2013, the editor has made this specification available
6 September 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 @@ -1060,7 +1060,7 @@ <h4 id="the-send()-method"><span class="secno">4.6.6 </span>The <code title="">s
throws.

<p class="XXX">Should we only encode as utf-8? What happens in the face
of an <a class="external" href="http://encoding.spec.whatwg.org/#encoder-error">encoder error</a>?
of an <a class="external" href="http://encoding.spec.whatwg.org/#error">error</a>?

<p class="note">In particular, if the document cannot be serialized an
"<code class="external"><a href="http://dom.spec.whatwg.org/#invalidstateerror">InvalidStateError</a></code>" exception is
Expand Down Expand Up @@ -1676,7 +1676,7 @@ <h4 id="the-abort()-method"><span class="secno">4.6.8 </span>The <code title="">
is dispatched.

<li>
<p>Otherwise run these substeps:
<p>Otherwise, run these substeps:

<ol>
<li><p>Change the state to <a href="#dom-xmlhttprequest-done" title="dom-XMLHttpRequest-DONE">DONE</a>.
Expand Down Expand Up @@ -2054,8 +2054,8 @@ <h4 id="response-entity-body-0"><span class="secno">4.7.5 </span>Response entity
<a class="external" href="http://encoding.spec.whatwg.org/#utf-8-decode">utf-8 decode</a> on byte stream
<a href="#response-entity-body">response entity body</a>.

<li><p>Return the result of invoking the <code title="">parse</code> function
of the <code title="">JSON</code> object defined in ECMAScript, with
<li><p>Return the result of invoking the initial value of the <code title="">parse</code>
property of the <code title="">JSON</code> object defined in JavaScript, with

This comment has been minimized.

Copy link
@DavidBruant

DavidBruant Sep 6, 2013

In case that helps, for these cases, the ES5 spec writes:

"where X is the standard built-in [function] with that name."

See http://es5.github.io/#x8.10.4 (step 2)

This comment has been minimized.

Copy link
@annevk

annevk Sep 6, 2013

Author Member

I'm mostly waiting for %JSONParse% or some such. I saw @domenic use this somewhere and it seemed clear enough for now.

This comment has been minimized.

Copy link
@domenic

domenic Sep 6, 2013

Member

ES6 spec uses "initial value", see e.g. http://people.mozilla.org/~jorendorff/es6-draft.html#table-7 or Ctrl+F for more usages.

<var title="">JSON text</var> as its only argument, or null if that function
throws an exception. <a href="#refsECMASCRIPT">[ECMASCRIPT]</a>
</ol>
Expand Down Expand Up @@ -2780,6 +2780,7 @@ <h2 class="no-num" id="acknowledgments">Acknowledgments</h2>
Elliotte Harold,
Eric Lawrence,
Eric Uhrhane,
Erik Arvidsson,
Erik Dahlström,
Feras Moussa,
Geoffrey Sneddon,
Expand Down
9 changes: 5 additions & 4 deletions Overview.src.html
Expand Up @@ -1012,7 +1012,7 @@ <h4>The <code title>send()</code> method</h4>
throws.

<p class=XXX>Should we only encode as utf-8? What happens in the face
of an <span data-anolis-spec=encoding>encoder error</span>?
of an <span data-anolis-spec=encoding>error</span>?

<p class=note>In particular, if the document cannot be serialized an
"<code data-anolis-spec=dom>InvalidStateError</code>" exception is
Expand Down Expand Up @@ -1628,7 +1628,7 @@ <h4>The <code title>abort()</code> method</h4>
is dispatched.

<li>
<p>Otherwise run these substeps:
<p>Otherwise, run these substeps:

<ol>
<li><p>Change the state to <span title="dom-XMLHttpRequest-DONE">DONE</span>.
Expand Down Expand Up @@ -2006,8 +2006,8 @@ <h4>Response entity body</h4>
<span data-anolis-spec=encoding>utf-8 decode</span> on byte stream
<span>response entity body</span>.

<li><p>Return the result of invoking the <code title>parse</code> function
of the <code title>JSON</code> object defined in ECMAScript, with
<li><p>Return the result of invoking the initial value of the <code title>parse</code>
property of the <code title>JSON</code> object defined in JavaScript, with
<var title>JSON text</var> as its only argument, or null if that function
throws an exception. <span data-anolis-ref>ECMASCRIPT</span>
</ol>
Expand Down Expand Up @@ -2677,6 +2677,7 @@ <h2 class="no-num" id="acknowledgments">Acknowledgments</h2>
Elliotte Harold,
Eric Lawrence,
Eric Uhrhane,
Erik Arvidsson,
Erik Dahlstr&ouml;m,
Feras Moussa,
Geoffrey Sneddon,
Expand Down

0 comments on commit 02fff31

Please sign in to comment.