Skip to content

Commit 8c02b22

Browse files
committed
spec: Throw a TypeError if all fields are missing.
This makes sharing the empty dictionary, or a dictionary with only unrecognised fields, a programmer error, and is designed to aid in future extensions (since if new fields are added, it will be a TypeError to exclusively use them without feature detection). Closes #48.
1 parent 5c2c8bb commit 8c02b22

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

index.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,13 @@ <h4>
118118
<li>Let <var>p</var> be <a data-cite=
119119
"!promises-guide#a-new-promise">a new promise</a>.
120120
</li>
121+
<li>If none of <var>data</var>'s members <a for=
122+
"ShareData">title</a>, <a for="ShareData">text</a>, or <a for=
123+
"ShareData">url</a> are present, reject <var>p</var> with
124+
<a data-cite=
125+
"!WEBIDL#exceptiondef-typeerror"><code>TypeError</code></a>, and
126+
abort these steps.
127+
</li>
121128
<li>If <var>data</var>'s <a for="ShareData">url</a> member is
122129
<a data-cite="!WEBIDL#dfn-present">present</a>:
123130
<ol>

0 commit comments

Comments
 (0)