Skip to content

Commit

Permalink
[LC-36] disallow calling operations with funny order optional arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
heycam committed Nov 6, 2013
1 parent d775aa7 commit 3785917
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 4 deletions.
17 changes: 15 additions & 2 deletions Overview.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Web IDL</title>
<meta name="revision" content="$Id: Overview.html,v 1.364 2011-08-29 01:06:47 cmccorma Exp $" />
<meta name="revision" content="$Id: Overview.html,v 1.365 2011-08-29 04:28:03 cmccorma Exp $" />
<link rel="stylesheet" href="WebIDL.css" type="text/css" />
<script src="section-links.js" type="application/ecmascript"></script>
<script src="dfn.js" type="application/ecmascript"></script>
Expand Down Expand Up @@ -49,7 +49,7 @@ <h2>Abstract</h2>
http://www.w3.org/mid/[email protected]
-->

<div class="ednote"><div class="ednoteHeader">Editorial note</div><p>This version of the document is built from source revision &#36;Id: Overview.xml,v 1.365 2011/08/29 00:39:12 cmccorma Exp $.</p><p>
<div class="ednote"><div class="ednoteHeader">Editorial note</div><p>This version of the document is built from source revision &#36;Id: Overview.xml,v 1.366 2011/08/29 01:06:47 cmccorma Exp $.</p><p>
There are 3 further editorial notes in the document.

In addition, there is a list of <a href="http://www.w3.org/Bugs/Public/buglist.cgi?query_format=advanced&amp;amp;short_desc_type=allwordssubstr&amp;amp;short_desc=&amp;amp;product=WebAppsWG&amp;amp;component=WebIDL&amp;amp;longdesc_type=allwordssubstr&amp;amp;longdesc=&amp;amp;bug_file_loc_type=allwordssubstr&amp;amp;bug_file_loc=&amp;amp;status_whiteboard_type=allwordssubstr&amp;amp;status_whiteboard=&amp;amp;keywords_type=allwords&amp;amp;keywords=&amp;amp;bug_status=NEW&amp;amp;bug_status=ASSIGNED&amp;amp;bug_status=REOPENED&amp;amp;emailtype1=substring&amp;amp;email1=&amp;amp;emailtype2=substring&amp;amp;email2=&amp;amp;bug_id_type=anyexact&amp;amp;bug_id=&amp;amp;votes=&amp;amp;chfieldfrom=&amp;amp;chfieldto=Now&amp;amp;chfieldvalue=&amp;amp;cmdtype=doit&amp;amp;order=Importance&amp;amp;field0-0-0=noop&amp;amp;type0-0-0=noop&amp;amp;value0-0-0=">open bugs</a> on the document, some of which may be covered by editorial notes.
Expand Down Expand Up @@ -1422,6 +1422,19 @@ <h4>3.3.3. Operations</h4>
</p>
<pre class="syntax"><i>return-type</i> <i>identifier</i>(<i>type</i> <i>identifier</i>, optional <i>type</i> <i>identifier</i>);</pre>

<p>
Web IDL operations do not support being called with omitted optional arguments
unless all subsequent optional arguments are also omitted. Bindings for
languages that do support function calling in this way will fail such
calls in a language binding specific manner.
</p>
<div class="note"><div class="noteHeader">Note</div>
<p>
ECMAScript and Java, the two language for which bindings are specified
in this document, do not support function calling like this.
</p>
</div>

<div class="example"><div class="exampleHeader">Example</div>
<p>
The following <a class="dfnref" href="#dfn-idl-fragment">IDL fragment</a>
Expand Down
15 changes: 14 additions & 1 deletion Overview.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<head>
<meta http-equiv='Content-Type' content='text/html; charset=UTF-8'/>
<title>Web IDL</title>
<meta name='revision' content='$Id: Overview.xml,v 1.366 2011-08-29 01:06:47 cmccorma Exp $'/>
<meta name='revision' content='$Id: Overview.xml,v 1.367 2011-08-29 04:28:03 cmccorma Exp $'/>
<link rel='stylesheet' href='WebIDL.css' type='text/css'/>
<script src='section-links.js' type='application/ecmascript'/>
<script src='dfn.js' type='application/ecmascript'/>
Expand Down Expand Up @@ -1388,6 +1388,19 @@ s.union(1, 4, 7); <span class='comment'>// Passing three arguments corre
</p>
<pre class='syntax'><i>return-type</i> <i>identifier</i>(<i>type</i> <i>identifier</i>, optional <i>type</i> <i>identifier</i>);</pre>

<p>
Web IDL operations do not support being called with omitted optional arguments
unless all subsequent optional arguments are also omitted. Bindings for
languages that do support function calling in this way will fail such
calls in a language binding specific manner.
</p>
<div class='note'>
<p>
ECMAScript and Java, the two language for which bindings are specified
in this document, do not support function calling like this.
</p>
</div>

<div class='example'>
<p>
The following <a class='dfnref' href='#dfn-idl-fragment'>IDL fragment</a>
Expand Down
2 changes: 1 addition & 1 deletion lc1.txt
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ Status: accepted
From: Travis Leithead <[email protected]>
Title: explicitly disallow passing optional parameters out of order
URL: http://www.w3.org/mid/9768D477C67135458BF978A45BCF9B3830836BF5@TK5EX14MBXW602.wingroup.windeploy.ntdev.microsoft.com
Status: raised
Status: accepted

[LC-37]
From: Travis Leithead <[email protected]>
Expand Down

0 comments on commit 3785917

Please sign in to comment.