Skip to content

Commit 8a6a92c

Browse files
authored
Correct PushMessageData
Give PushMessageData a clear internal concept to hold the bytes and also make it clear that it cannot be null. None of the methods were prepared to handle it being null and nothing ever creates a PushMessageData object where it is null. Partially addresses the concerns in #380 and fixes #381.
1 parent f30bf3d commit 8a6a92c

File tree

1 file changed

+13
-14
lines changed

1 file changed

+13
-14
lines changed

index.html

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -982,31 +982,30 @@ <h2>
982982
};
983983
</pre>
984984
<p>
985-
<a>PushMessageData</a> objects have an associated [=byte sequence=] set on creation, which
986-
is `null` if there was no data in the <a>push message</a>.
985+
<a>PushMessageData</a> objects have an associated <dfn>bytes</dfn> (a
986+
[=byte sequence=]), which is set on creation.
987987
</p>
988988
<p>
989-
The <dfn>arrayBuffer()</dfn> method, when invoked, MUST return an {{ArrayBuffer}} whose
990-
contents are |bytes|. Exceptions thrown during the creation of the {{ArrayBuffer}} object
991-
are re-thrown.
989+
The <dfn>arrayBuffer()</dfn> method steps are to return an {{ArrayBuffer}} whose contents
990+
are [=this=]'s [=bytes=]. Exceptions thrown during the creation of
991+
the {{ArrayBuffer}} object are re-thrown.
992992
</p>
993993
<p>
994-
The <dfn>blob()</dfn> method, when invoked, MUST return a {{Blob}} whose contents are
995-
|bytes| and |type| is not provided.
994+
The <dfn>blob()</dfn> method steps are to return a new {{Blob}} object whose contents are
995+
[=this=]'s [=bytes=].
996996
</p>
997997
<p>
998-
The <dfn>bytes()</dfn> method, when invoked, MUST return a {{Uint8Array}} backed by a
999-
{{ArrayBuffer}} whose contents are |bytes|. Exceptions thrown during the creation of the
998+
The <dfn>bytes()</dfn> method steps are to return a new {{Uint8Array}} backed by a
999+
{{ArrayBuffer}} whose contents are [=this=]'s [=bytes=]. Exceptions thrown during the creation of the
10001000
{{ArrayBuffer}} object are re-thrown.
10011001
</p>
10021002
<p data-cite="encoding">
1003-
The <dfn>json()</dfn> method, when invoked, MUST return the result of invoking the initial
1004-
value of `JSON`.{{JSON/parse()}} with the result of running <a>utf-8 decode</a> on |bytes|
1005-
as argument. Re-throw any exceptions thrown by `JSON`.{{JSON/parse()}}.
1003+
The <dfn>json()</dfn> method steps are to return the result of
1004+
<a>parsing JSON bytes to a JavaScript value</a> given [=this=]'s [=bytes=].
10061005
</p>
10071006
<p data-cite="encoding">
1008-
The <dfn>text</dfn> method, when invoked, MUST return the result of running <a>utf-8
1009-
decode</a> on |bytes|.
1007+
The <dfn>text()</dfn> method steps are to return the result of running <a>UTF-8 decode</a>
1008+
on [=this=]'s [=bytes=].
10101009
</p>
10111010
<p>
10121011
To <dfn>extract a byte sequence</dfn> from |object|, run these steps:

0 commit comments

Comments
 (0)