Skip to content

Commit

Permalink
Add a convenience ok getter on Response (fixes #18)
Browse files Browse the repository at this point in the history
  • Loading branch information
annevk committed Jan 27, 2015
1 parent bb2c619 commit e62f57b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Overview.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<p><a class="logo" href="//whatwg.org/"><img height="100" src="//resources.whatwg.org/logo-fetch.svg" width="100" alt="WHATWG"></a>
<h1 id="cors">Fetch</h1>
<h2 class="no-num no-toc" id="living-standard-—-last-updated-20-january-2015">Living Standard — Last Updated 20 January 2015</h2>
<h2 class="no-num no-toc" id="living-standard-—-last-updated-27-january-2015">Living Standard — Last Updated 27 January 2015</h2>

<dl>
<dt>Participate:
Expand Down Expand Up @@ -3145,6 +3145,7 @@ <h3 id="response-class"><span class="secno">5.4 </span>Response class</h3>

readonly attribute USVString <a title="dom-Response-url" href="#dom-response-url">url</a>;
readonly attribute unsigned short <a title="dom-Response-status" href="#dom-response-status">status</a>;
readonly attribute boolean <a title="dom-Response-ok" href="#dom-response-ok">ok</a>;
readonly attribute ByteString <a title="dom-Response-statusText" href="#dom-response-statustext">statusText</a>;
[SameObject] readonly attribute <a href="#headers">Headers</a> <a title="dom-Response-headers" href="#dom-response-headers">headers</a>;

Expand Down Expand Up @@ -3303,6 +3304,11 @@ <h3 id="response-class"><span class="secno">5.4 </span>Response class</h3>
return <a title="concept-Response-response" href="#concept-response-response">response</a>'s
<a title="concept-response-status" href="#concept-response-status">status</a>.

<p>The <dfn title="dom-Response-ok" id="dom-response-ok"><code>ok</code></dfn> attribute's getter must
return true if <a title="concept-Response-response" href="#concept-response-response">response</a>'s
<a title="concept-response-status" href="#concept-response-status">status</a> is in the range 200 to 299, and false
otherwise.

<p>The <dfn title="dom-Response-statusText" id="dom-response-statustext"><code>statusText</code></dfn> attribute's getter
must return <a title="concept-Response-response" href="#concept-response-response">response</a>'s
<a title="concept-response-status-message" href="#concept-response-status-message">status message</a>.
Expand Down Expand Up @@ -3587,6 +3593,7 @@ <h2 class="no-num" id="acknowledgments">Acknowledgments</h2>
Mark Nottingham,
Mark S. Miller,
Martin Dürst,
Matt Andrews,
Matt Falkenhagen,
Matt Oshry,
Matt Womer,
Expand Down
7 changes: 7 additions & 0 deletions Overview.src.html
Original file line number Diff line number Diff line change
Expand Up @@ -3099,6 +3099,7 @@ <h3>Response class</h3>

readonly attribute USVString <span title=dom-Response-url>url</span>;
readonly attribute unsigned short <span title=dom-Response-status>status</span>;
readonly attribute boolean <span title=dom-Response-ok>ok</span>;
readonly attribute ByteString <span title=dom-Response-statusText>statusText</span>;
[SameObject] readonly attribute <span>Headers</span> <span title=dom-Response-headers>headers</span>;

Expand Down Expand Up @@ -3257,6 +3258,11 @@ <h3>Response class</h3>
return <span title=concept-Response-response>response</span>'s
<span title=concept-response-status>status</span>.

<p>The <dfn title=dom-Response-ok><code>ok</code></dfn> attribute's getter must
return true if <span title=concept-Response-response>response</span>'s
<span title=concept-response-status>status</span> is in the range 200 to 299, and false
otherwise.

<p>The <dfn title=dom-Response-statusText><code>statusText</code></dfn> attribute's getter
must return <span title=concept-Response-response>response</span>'s
<span title=concept-response-status-message>status message</span>.
Expand Down Expand Up @@ -3480,6 +3486,7 @@ <h2 class=no-num>Acknowledgments</h2>
Mark Nottingham,
Mark S. Miller,
Martin D&uuml;rst,
Matt Andrews,
Matt Falkenhagen,
Matt Oshry,
Matt Womer,
Expand Down

2 comments on commit e62f57b

@josh
Copy link

@josh josh commented on e62f57b Jan 27, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@dgraham
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.