Skip to content

Commit

Permalink
Merge pull request #8 from bzbarsky/undefined-not-null
Browse files Browse the repository at this point in the history
Use undefined, not null, as the default this value when invoking callbacks, to align with the ES6 specification.
  • Loading branch information
heycam committed Jan 10, 2014
2 parents 78f32b9 + ac6419c commit b495c5e
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 14 deletions.
15 changes: 10 additions & 5 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
<link rel="stylesheet" href="http://www.w3.org/StyleSheets/TR/W3C-ED" type="text/css" /></head>

<body>
<div class="head"><div><a href="http://www.w3.org/"><img src="http://www.w3.org/Icons/w3c_home" width="72" height="48" alt="W3C" /></a></div><h1>Web IDL (Second Edition)</h1><h2>W3C Editor’s Draft <em>13 December 2013</em></h2><dl><dt>This Version:</dt><dd><a href="http://heycam.github.io/webidl/">http://heycam.github.io/webidl/</a></dd><dt>Latest Version:</dt><dd><a href="http://www.w3.org/TR/WebIDL/">http://www.w3.org/TR/WebIDL/</a></dd><dt>Previous Versions:</dt><dd><a href="http://www.w3.org/TR/2012/CR-WebIDL-20120419/">http://www.w3.org/TR/2012/CR-WebIDL-20120419/</a></dd><dd><a href="http://www.w3.org/TR/2012/WD-WebIDL-20120207/">http://www.w3.org/TR/2012/WD-WebIDL-20120207/</a></dd><dd><a href="http://www.w3.org/TR/2011/WD-WebIDL-20110927/">http://www.w3.org/TR/2011/WD-WebIDL-20110927/</a></dd><dd><a href="http://www.w3.org/TR/2011/WD-WebIDL-20110712/">http://www.w3.org/TR/2011/WD-WebIDL-20110712/</a></dd><dd><a href="http://www.w3.org/TR/2010/WD-WebIDL-20101021/">http://www.w3.org/TR/2010/WD-WebIDL-20101021/</a></dd><dd><a href="http://www.w3.org/TR/2008/WD-WebIDL-20081219/">http://www.w3.org/TR/2008/WD-WebIDL-20081219/</a></dd><dd><a href="http://www.w3.org/TR/2008/WD-WebIDL-20080829/">http://www.w3.org/TR/2008/WD-WebIDL-20080829/</a></dd><dd><a href="http://www.w3.org/TR/2008/WD-DOM-Bindings-20080410/">http://www.w3.org/TR/2008/WD-DOM-Bindings-20080410/</a></dd><dd><a href="http://www.w3.org/TR/2007/WD-DOM-Bindings-20071017/">http://www.w3.org/TR/2007/WD-DOM-Bindings-20071017/</a></dd><dt>Participate:</dt><dd>
<div class="head"><div><a href="http://www.w3.org/"><img src="http://www.w3.org/Icons/w3c_home" width="72" height="48" alt="W3C" /></a></div><h1>Web IDL (Second Edition)</h1><h2>W3C Editor’s Draft <em>9 January 2014</em></h2><dl><dt>This Version:</dt><dd><a href="http://heycam.github.io/webidl/">http://heycam.github.io/webidl/</a></dd><dt>Latest Version:</dt><dd><a href="http://www.w3.org/TR/WebIDL/">http://www.w3.org/TR/WebIDL/</a></dd><dt>Previous Versions:</dt><dd><a href="http://www.w3.org/TR/2012/CR-WebIDL-20120419/">http://www.w3.org/TR/2012/CR-WebIDL-20120419/</a></dd><dd><a href="http://www.w3.org/TR/2012/WD-WebIDL-20120207/">http://www.w3.org/TR/2012/WD-WebIDL-20120207/</a></dd><dd><a href="http://www.w3.org/TR/2011/WD-WebIDL-20110927/">http://www.w3.org/TR/2011/WD-WebIDL-20110927/</a></dd><dd><a href="http://www.w3.org/TR/2011/WD-WebIDL-20110712/">http://www.w3.org/TR/2011/WD-WebIDL-20110712/</a></dd><dd><a href="http://www.w3.org/TR/2010/WD-WebIDL-20101021/">http://www.w3.org/TR/2010/WD-WebIDL-20101021/</a></dd><dd><a href="http://www.w3.org/TR/2008/WD-WebIDL-20081219/">http://www.w3.org/TR/2008/WD-WebIDL-20081219/</a></dd><dd><a href="http://www.w3.org/TR/2008/WD-WebIDL-20080829/">http://www.w3.org/TR/2008/WD-WebIDL-20080829/</a></dd><dd><a href="http://www.w3.org/TR/2008/WD-DOM-Bindings-20080410/">http://www.w3.org/TR/2008/WD-DOM-Bindings-20080410/</a></dd><dd><a href="http://www.w3.org/TR/2007/WD-DOM-Bindings-20071017/">http://www.w3.org/TR/2007/WD-DOM-Bindings-20071017/</a></dd><dt>Participate:</dt><dd>
Send feedback to <a href="mailto:public-script-coord@w3.org">public-script-coord@w3.org</a> or <a href="https://www.w3.org/Bugs/Public/enter_bug.cgi?product=WebAppsWG&amp;component=WebIDL">file a bug</a> (<a href="https://www.w3.org/Bugs/Public/buglist.cgi?product=WebAppsWG&amp;component=WebIDL&amp;resolution=---">open bugs</a>)
</dd><dt>Editor:</dt><dd><a href="http://mcc.id.au/">Cameron McCormack</a>, Mozilla Corporation &lt;cam@mcc.id.au&gt;</dd></dl><p class="copyright"><a href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright">Copyright</a> &copy; 2013 <a href="http://www.w3.org/"><abbr title="World Wide Web Consortium">W3C</abbr></a><sup>&reg;</sup> (<a href="http://www.csail.mit.edu/"><abbr title="Massachusetts Institute of Technology">MIT</abbr></a>, <a href="http://www.ercim.eu/"><abbr title="European Research Consortium for Informatics and Mathematics">ERCIM</abbr></a>, <a href="http://www.keio.ac.jp/">Keio</a>, <a href="http://ev.buaa.edu.cn/">Beihang</a>), All Rights Reserved. W3C <a href="http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</a>, <a href="http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a> and <a href="http://www.w3.org/Consortium/Legal/copyright-documents">document use</a> rules apply.</p></div><hr /><script async="" src="file-bug.js"></script>
</dd><dt>Editor:</dt><dd><a href="http://mcc.id.au/">Cameron McCormack</a>, Mozilla Corporation &lt;cam@mcc.id.au&gt;</dd></dl><p class="copyright"><a href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright">Copyright</a> &copy; 2014 <a href="http://www.w3.org/"><abbr title="World Wide Web Consortium">W3C</abbr></a><sup>&reg;</sup> (<a href="http://www.csail.mit.edu/"><abbr title="Massachusetts Institute of Technology">MIT</abbr></a>, <a href="http://www.ercim.eu/"><abbr title="European Research Consortium for Informatics and Mathematics">ERCIM</abbr></a>, <a href="http://www.keio.ac.jp/">Keio</a>, <a href="http://ev.buaa.edu.cn/">Beihang</a>), All Rights Reserved. W3C <a href="http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</a>, <a href="http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a> and <a href="http://www.w3.org/Consortium/Legal/copyright-documents">document use</a> rules apply.</p></div><hr /><script async="" src="file-bug.js"></script>

<!--
<div id='publication-warning'>
Expand Down Expand Up @@ -72,7 +72,7 @@ <h2 id="sotd">Status of This Document</h2>
report can be found in the <a href="http://www.w3.org/TR/">W3C technical
reports index</a> at http://www.w3.org/TR/.
</em></p><p>
This document is the 13 December 2013 <b>Editor’s Draft</b> of the
This document is the 9 January 2014 <b>Editor’s Draft</b> of the
<cite>Web IDL (Second Edition)</cite> specification.

Please send comments about this document to
Expand Down Expand Up @@ -13053,7 +13053,7 @@ <h3>4.8. User objects implementing callback interfaces</h3>
when a <a href="http://people.mozilla.org/~jorendorff/es6-draft.html#sec-9.2.2" class="dfnref external">callable</a>
object was supplied as the implementation of a
<a class="dfnref" href="#dfn-single-operation-callback-interface">single operation callback interface</a>.
By default, <span class="esvalue">null</span> is used as the <a class="dfnref" href="#dfn-callback-this-value">callback this value</a>,
By default, <span class="esvalue">undefined</span> is used as the <a class="dfnref" href="#dfn-callback-this-value">callback this value</a>,
however this <span class="rfc2119">MAY</span> be overridden by other
specifications.
</p>
Expand Down Expand Up @@ -13169,7 +13169,7 @@ <h3>4.9. Invoking callback functions</h3>
a missing optional argument), by
following the algorithm below. By default, the <a class="dfnref" href="#dfn-callback-this-value">callback this value</a>
when invoking a <a class="dfnref" href="#dfn-callback-function">callback function</a>
is <span class="esvalue">null</span>, unless overridden by other specifications.
is <span class="esvalue">undefined</span>, unless overridden by other specifications.
</p>
<ol class="algorithm">
<li>Let <var>V</var> be the IDL <a class="dfnref" href="#idl-callback-function">callback function type</a> value.</li>
Expand Down Expand Up @@ -14415,6 +14415,11 @@ <h2>C. Changes</h2>
</p>
</li>
<!-- below are changes in v1 too -->
<li>
<p>
Changed the default this value for callbacks from null to undefined.
</p>
</li>
<li>
<p>
Removed the requirement for named properties objects to be function objects.
Expand Down
9 changes: 7 additions & 2 deletions index.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12835,7 +12835,7 @@ C implements A;</x:codeblock>
when a <a href='http://people.mozilla.org/~jorendorff/es6-draft.html#sec-9.2.2' class='dfnref external'>callable</a>
object was supplied as the implementation of a
<a class='dfnref' href='#dfn-single-operation-callback-interface'>single operation callback interface</a>.
By default, <span class='esvalue'>null</span> is used as the <a class='dfnref' href='#dfn-callback-this-value'>callback this value</a>,
By default, <span class='esvalue'>undefined</span> is used as the <a class='dfnref' href='#dfn-callback-this-value'>callback this value</a>,
however this <span class='rfc2119'>MAY</span> be overridden by other
specifications.
</p>
Expand Down Expand Up @@ -12951,7 +12951,7 @@ C implements A;</x:codeblock>
a missing optional argument), by
following the algorithm below. By default, the <a class='dfnref' href='#dfn-callback-this-value'>callback this value</a>
when invoking a <a class='dfnref' href='#dfn-callback-function'>callback function</a>
is <span class='esvalue'>null</span>, unless overridden by other specifications.
is <span class='esvalue'>undefined</span>, unless overridden by other specifications.
</p>
<ol class='algorithm'>
<li>Let <var>V</var> be the IDL <a class='dfnref' href='#idl-callback-function'>callback function type</a> value.</li>
Expand Down Expand Up @@ -14204,6 +14204,11 @@ d.type = et;
</p>
</li>
<!-- below are changes in v1 too -->
<li>
<p>
Changed the default this value for callbacks from null to undefined.
</p>
</li>
<li>
<p>
Removed the requirement for named properties objects to be function objects.
Expand Down
15 changes: 10 additions & 5 deletions v1.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
<link rel="stylesheet" href="http://www.w3.org/StyleSheets/TR/W3C-ED" type="text/css" /></head>

<body>
<div class="head"><div><a href="http://www.w3.org/"><img src="http://www.w3.org/Icons/w3c_home" width="72" height="48" alt="W3C" /></a></div><h1>Web IDL</h1><h2>W3C Editor’s Draft <em>13 December 2013</em></h2><dl><dt>This Version:</dt><dd><a href="http://heycam.github.io/webidl/v1.html">http://heycam.github.io/webidl/v1.html</a></dd><dt>Latest Version:</dt><dd><a href="http://www.w3.org/TR/WebIDL/">http://www.w3.org/TR/WebIDL/</a></dd><dt>Previous Versions:</dt><dd><a href="http://www.w3.org/TR/2012/CR-WebIDL-20120419/">http://www.w3.org/TR/2012/CR-WebIDL-20120419/</a></dd><dd><a href="http://www.w3.org/TR/2012/WD-WebIDL-20120207/">http://www.w3.org/TR/2012/WD-WebIDL-20120207/</a></dd><dd><a href="http://www.w3.org/TR/2011/WD-WebIDL-20110927/">http://www.w3.org/TR/2011/WD-WebIDL-20110927/</a></dd><dd><a href="http://www.w3.org/TR/2011/WD-WebIDL-20110712/">http://www.w3.org/TR/2011/WD-WebIDL-20110712/</a></dd><dd><a href="http://www.w3.org/TR/2010/WD-WebIDL-20101021/">http://www.w3.org/TR/2010/WD-WebIDL-20101021/</a></dd><dd><a href="http://www.w3.org/TR/2008/WD-WebIDL-20081219/">http://www.w3.org/TR/2008/WD-WebIDL-20081219/</a></dd><dd><a href="http://www.w3.org/TR/2008/WD-WebIDL-20080829/">http://www.w3.org/TR/2008/WD-WebIDL-20080829/</a></dd><dd><a href="http://www.w3.org/TR/2008/WD-DOM-Bindings-20080410/">http://www.w3.org/TR/2008/WD-DOM-Bindings-20080410/</a></dd><dd><a href="http://www.w3.org/TR/2007/WD-DOM-Bindings-20071017/">http://www.w3.org/TR/2007/WD-DOM-Bindings-20071017/</a></dd><dt>Participate:</dt><dd>
<div class="head"><div><a href="http://www.w3.org/"><img src="http://www.w3.org/Icons/w3c_home" width="72" height="48" alt="W3C" /></a></div><h1>Web IDL</h1><h2>W3C Editor’s Draft <em>9 January 2014</em></h2><dl><dt>This Version:</dt><dd><a href="http://heycam.github.io/webidl/v1.html">http://heycam.github.io/webidl/v1.html</a></dd><dt>Latest Version:</dt><dd><a href="http://www.w3.org/TR/WebIDL/">http://www.w3.org/TR/WebIDL/</a></dd><dt>Previous Versions:</dt><dd><a href="http://www.w3.org/TR/2012/CR-WebIDL-20120419/">http://www.w3.org/TR/2012/CR-WebIDL-20120419/</a></dd><dd><a href="http://www.w3.org/TR/2012/WD-WebIDL-20120207/">http://www.w3.org/TR/2012/WD-WebIDL-20120207/</a></dd><dd><a href="http://www.w3.org/TR/2011/WD-WebIDL-20110927/">http://www.w3.org/TR/2011/WD-WebIDL-20110927/</a></dd><dd><a href="http://www.w3.org/TR/2011/WD-WebIDL-20110712/">http://www.w3.org/TR/2011/WD-WebIDL-20110712/</a></dd><dd><a href="http://www.w3.org/TR/2010/WD-WebIDL-20101021/">http://www.w3.org/TR/2010/WD-WebIDL-20101021/</a></dd><dd><a href="http://www.w3.org/TR/2008/WD-WebIDL-20081219/">http://www.w3.org/TR/2008/WD-WebIDL-20081219/</a></dd><dd><a href="http://www.w3.org/TR/2008/WD-WebIDL-20080829/">http://www.w3.org/TR/2008/WD-WebIDL-20080829/</a></dd><dd><a href="http://www.w3.org/TR/2008/WD-DOM-Bindings-20080410/">http://www.w3.org/TR/2008/WD-DOM-Bindings-20080410/</a></dd><dd><a href="http://www.w3.org/TR/2007/WD-DOM-Bindings-20071017/">http://www.w3.org/TR/2007/WD-DOM-Bindings-20071017/</a></dd><dt>Participate:</dt><dd>
Send feedback to <a href="mailto:public-script-coord@w3.org">public-script-coord@w3.org</a> or <a href="https://www.w3.org/Bugs/Public/enter_bug.cgi?product=WebAppsWG&amp;component=WebIDL">file a bug</a> (<a href="https://www.w3.org/Bugs/Public/buglist.cgi?product=WebAppsWG&amp;component=WebIDL&amp;resolution=---">open bugs</a>)
</dd><dt>Editor:</dt><dd><a href="http://mcc.id.au/">Cameron McCormack</a>, Mozilla Corporation &lt;cam@mcc.id.au&gt;</dd></dl><p class="copyright"><a href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright">Copyright</a> &copy; 2013 <a href="http://www.w3.org/"><abbr title="World Wide Web Consortium">W3C</abbr></a><sup>&reg;</sup> (<a href="http://www.csail.mit.edu/"><abbr title="Massachusetts Institute of Technology">MIT</abbr></a>, <a href="http://www.ercim.eu/"><abbr title="European Research Consortium for Informatics and Mathematics">ERCIM</abbr></a>, <a href="http://www.keio.ac.jp/">Keio</a>, <a href="http://ev.buaa.edu.cn/">Beihang</a>), All Rights Reserved. W3C <a href="http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</a>, <a href="http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a> and <a href="http://www.w3.org/Consortium/Legal/copyright-documents">document use</a> rules apply.</p></div><hr /><script async="" src="file-bug.js"></script>
</dd><dt>Editor:</dt><dd><a href="http://mcc.id.au/">Cameron McCormack</a>, Mozilla Corporation &lt;cam@mcc.id.au&gt;</dd></dl><p class="copyright"><a href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright">Copyright</a> &copy; 2014 <a href="http://www.w3.org/"><abbr title="World Wide Web Consortium">W3C</abbr></a><sup>&reg;</sup> (<a href="http://www.csail.mit.edu/"><abbr title="Massachusetts Institute of Technology">MIT</abbr></a>, <a href="http://www.ercim.eu/"><abbr title="European Research Consortium for Informatics and Mathematics">ERCIM</abbr></a>, <a href="http://www.keio.ac.jp/">Keio</a>, <a href="http://ev.buaa.edu.cn/">Beihang</a>), All Rights Reserved. W3C <a href="http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</a>, <a href="http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a> and <a href="http://www.w3.org/Consortium/Legal/copyright-documents">document use</a> rules apply.</p></div><hr /><script async="" src="file-bug.js"></script>

<!--
<div id='publication-warning'>
Expand Down Expand Up @@ -72,7 +72,7 @@ <h2 id="sotd">Status of This Document</h2>
report can be found in the <a href="http://www.w3.org/TR/">W3C technical
reports index</a> at http://www.w3.org/TR/.
</em></p><p>
This document is the 13 December 2013 <b>Editor’s Draft</b> of the
This document is the 9 January 2014 <b>Editor’s Draft</b> of the
<cite>Web IDL</cite> specification.

Please send comments about this document to
Expand Down Expand Up @@ -10902,7 +10902,7 @@ <h3>4.8. User objects implementing callback interfaces</h3>
when a <a href="http://people.mozilla.org/~jorendorff/es6-draft.html#sec-9.2.2" class="dfnref external">callable</a>
object was supplied as the implementation of a
<a class="dfnref" href="#dfn-single-operation-callback-interface">single operation callback interface</a>.
By default, <span class="esvalue">null</span> is used as the <a class="dfnref" href="#dfn-callback-this-value">callback this value</a>,
By default, <span class="esvalue">undefined</span> is used as the <a class="dfnref" href="#dfn-callback-this-value">callback this value</a>,
however this <span class="rfc2119">MAY</span> be overridden by other
specifications.
</p>
Expand Down Expand Up @@ -11014,7 +11014,7 @@ <h3>4.9. Invoking callback functions</h3>
each of which is either an IDL value or the special value “missing” (representing
a missing optional argument), by following the algorithm below. By default, the <a class="dfnref" href="#dfn-callback-this-value">callback this value</a>
when invoking a <a class="dfnref" href="#dfn-callback-function">callback function</a>
is <span class="esvalue">null</span>, unless overridden by other specifications.
is <span class="esvalue">undefined</span>, unless overridden by other specifications.
</p>
<ol class="algorithm">
<li>Let <var>V</var> be the IDL <a class="dfnref" href="#idl-callback-function">callback function type</a> value.</li>
Expand Down Expand Up @@ -12159,6 +12159,11 @@ <h2>D. Changes</h2>
<dt>Current editor’s draft</dt>
<dd>
<ul>
<li>
<p>
Changed the default this value for callbacks from null to undefined.
</p>
</li>
<li>
<p>
Removed the requirement for named properties objects to be function objects.
Expand Down
9 changes: 7 additions & 2 deletions v1.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10706,7 +10706,7 @@ C implements A;</x:codeblock>
when a <a href='http://people.mozilla.org/~jorendorff/es6-draft.html#sec-9.2.2' class='dfnref external'>callable</a>
object was supplied as the implementation of a
<a class='dfnref' href='#dfn-single-operation-callback-interface'>single operation callback interface</a>.
By default, <span class='esvalue'>null</span> is used as the <a class='dfnref' href='#dfn-callback-this-value'>callback this value</a>,
By default, <span class='esvalue'>undefined</span> is used as the <a class='dfnref' href='#dfn-callback-this-value'>callback this value</a>,
however this <span class='rfc2119'>MAY</span> be overridden by other
specifications.
</p>
Expand Down Expand Up @@ -10818,7 +10818,7 @@ C implements A;</x:codeblock>
each of which is either an IDL value or the special value “missing” (representing
a missing optional argument), by following the algorithm below. By default, the <a class='dfnref' href='#dfn-callback-this-value'>callback this value</a>
when invoking a <a class='dfnref' href='#dfn-callback-function'>callback function</a>
is <span class='esvalue'>null</span>, unless overridden by other specifications.
is <span class='esvalue'>undefined</span>, unless overridden by other specifications.
</p>
<ol class='algorithm'>
<li>Let <var>V</var> be the IDL <a class='dfnref' href='#idl-callback-function'>callback function type</a> value.</li>
Expand Down Expand Up @@ -11979,6 +11979,11 @@ d.type = et;
<dt>Current editor’s draft</dt>
<dd>
<ul>
<li>
<p>
Changed the default this value for callbacks from null to undefined.
</p>
</li>
<li>
<p>
Removed the requirement for named properties objects to be function objects.
Expand Down

0 comments on commit b495c5e

Please sign in to comment.