Skip to content

Commit

Permalink
spec: Make ShareData argument optional.
Browse files Browse the repository at this point in the history
This has no behavioural change, as passing an empty dictionary is a
TypeError. But it is required by the WebIDL spec.

Closes w3c#47.
  • Loading branch information
mgiuca committed Jul 3, 2017
1 parent 0c7a74d commit 3525449
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,19 @@ <h3>
</p>
<pre class="idl">
partial interface Navigator {
[SecureContext] Promise&lt;void&gt; share(ShareData data);
[SecureContext] Promise&lt;void&gt; share(optional ShareData data);
};
</pre>
<div class="note">
The <var>data</var> argument is marked as "optional", but really it
is required; <a for="Navigator"><code>share</code></a> will throw a
<a data-cite=
"!WEBIDL#exceptiondef-typeerror"><code>TypeError</code></a> if called
with no arguments. WebIDL <a data-cite=
"!WEBIDL#idl-operations">mandates that it be optional</a>, because
the dictionary members are all optional. See WebIDL <a href=
"https://github.com/heycam/webidl/issues/130">Issue #130</a>.
</div>
<p>
User agents that do not support sharing SHOULD NOT expose <a for=
"Navigator"><code>share</code></a> on the
Expand Down

0 comments on commit 3525449

Please sign in to comment.