[html5] r2117 - [] (0) Make postMessage() return void. (credit: js)

whatwg at whatwg.org whatwg at whatwg.org
Wed Aug 27 02:50:20 PDT 2008


Author: ianh
Date: 2008-08-27 02:50:18 -0700 (Wed, 27 Aug 2008)
New Revision: 2117

Modified:
   index
   source
Log:
[] (0) Make postMessage() return void. (credit: js)

Modified: index
===================================================================
--- index	2008-08-26 10:36:25 UTC (rev 2116)
+++ index	2008-08-27 09:50:18 UTC (rev 2117)
@@ -28,7 +28,7 @@
 
    <h1 id=html-5>HTML 5</h1>
 
-   <h2 class="no-num no-toc" id=draft>Draft Recommendation — 26 August
+   <h2 class="no-num no-toc" id=draft>Draft Recommendation — 27 August
     2008</h2>
 
    <p>You can take part in this work. <a
@@ -44859,8 +44859,8 @@
 
   <pre class=idl>interface <dfn id=messageport0>MessagePort</dfn> {
   readonly attribute boolean <a href="#active0" title=dom-MessagePort-active>active</a>;
-  boolean <a href="#postmessage2" title=dom-MessagePort-postMessage>postMessage</a>(in DOMString message);
-  boolean <a href="#postmessage2" title=dom-MessagePort-postMessage>postMessage</a>(in DOMString message, in <a href="#messageport0">MessagePort</a> messagePort);
+  void <a href="#postmessage2" title=dom-MessagePort-postMessage>postMessage</a>(in DOMString message);
+  void <a href="#postmessage2" title=dom-MessagePort-postMessage>postMessage</a>(in DOMString message, in <a href="#messageport0">MessagePort</a> messagePort);
   <a href="#messageport0">MessagePort</a> <a href="#startconversation" title=dom-MessagePort-startConversation>startConversation</a>(in DOMString message);
   void <a href="#start6" title=dom-MessagePort-start>start</a>();
   void <a href="#close3" title=dom-MessagePort-close>close</a>();
@@ -44973,12 +44973,12 @@
 
    <li>
     <p>If the <var title="">source port</var> is not entangled with another
-     port, then return false and abort these steps.
+     port, then return and abort these steps.
    </li>
    <!-- we don't raise an exception because this can happen moment's
-   notice, but we return false so that the caller can check whether
-   the port was active at time of calling without a race
-   condition. -->
+   notice. listen to onclose if you want to know when things start
+   going wonky. (We don't return false because if the port is _about_
+   to be closed, the message might not be listened for anyway.) -->
 
    <li>
     <p>Let <var title="">target port</var> be the port with which <var
@@ -45020,7 +45020,7 @@
     </ol>
 
    <li>
-    <p>Return true from the method, but continue with these steps.
+    <p>Return from the method, but continue with these steps.
 
    <li>
     <p>Add the event to the <a href="#port-message">port message queue</a> of
@@ -45047,20 +45047,34 @@
     <p>Let <var title="">message</var> be the method's first argument.
 
    <li>
+    <p><a href="#create">Create a new <code>MessagePort</code> object</a>
+     owned by the <a href="#script2">script execution context</a>, and let
+     <var title="">port1</var> be that object.
+
+   <li>
     <p>If the <var title="">source port</var> is not entangled with another
-     port, then return null and abort these steps.
+     port, then return <var title="">port1</var> and abort these steps.
    </li>
-   <!--
-   we don't raise an exception because this can happen moment's
-   notice, but we return false so that the caller can check whether
-   the port was active at time of calling without a race
-   condition. -->
+   <!-- we don't raise an exception because this can happen moment's
+   notice. listen to onclose if you want to know when things start
+   going wonky. (We don't return null because then we'd end up with
+   null derefs. better to just let the likely next postMessage call
+   fall on the floor) -->
 
    <li>
     <p>Let <var title="">target port</var> be the port with which <var
      title="">source port</var> is entangled.
 
    <li>
+    <p><a href="#create">Create a new <code>MessagePort</code> object</a>
+     owned by the owner of the <var title="">target port</var>, and let <var
+     title="">port2</var> be that object.
+
+   <li>
+    <p><a href="#entangle">Entangle</a> the <var title="">port1</var> and
+     <var title="">port2</var> objects.
+
+   <li>
     <p>Create an event that uses the <code><a
      href="#messageevent">MessageEvent</a></code> interface, with the name
      <code title=event-message><a href="#message2">message</a></code>, which
@@ -45072,20 +45086,6 @@
      <var title="">message</var>, the method's first argument.
 
    <li>
-    <p><a href="#create">Create a new <code>MessagePort</code> object</a>
-     owned by the <a href="#script2">script execution context</a>, and let
-     <var title="">port1</var> be that object.
-
-   <li>
-    <p><a href="#create">Create a new <code>MessagePort</code> object</a>
-     owned by the owner of the <var title="">target port</var>, and let <var
-     title="">port2</var> be that object.
-
-   <li>
-    <p><a href="#entangle">Entangle</a> the <var title="">port1</var> and
-     <var title="">port2</var> objects.
-
-   <li>
     <p>Let the <code title=dom-MessageEvent-messagePort><a
      href="#messageport">messagePort</a></code> attribute of the event be
      <var title="">port2</var>.

Modified: source
===================================================================
--- source	2008-08-26 10:36:25 UTC (rev 2116)
+++ source	2008-08-27 09:50:18 UTC (rev 2117)
@@ -42306,8 +42306,8 @@
 
   <pre class="idl">interface <dfn>MessagePort</dfn> {
   readonly attribute boolean <span title="dom-MessagePort-active">active</span>;
-  boolean <span title="dom-MessagePort-postMessage">postMessage</span>(in DOMString message);
-  boolean <span title="dom-MessagePort-postMessage">postMessage</span>(in DOMString message, in <span>MessagePort</span> messagePort);
+  void <span title="dom-MessagePort-postMessage">postMessage</span>(in DOMString message);
+  void <span title="dom-MessagePort-postMessage">postMessage</span>(in DOMString message, in <span>MessagePort</span> messagePort);
   <span>MessagePort</span> <span title="dom-MessagePort-startConversation">startConversation</span>(in DOMString message);
   void <span title="dom-MessagePort-start">start</span>();
   void <span title="dom-MessagePort-close">close</span>();
@@ -42418,11 +42418,11 @@
    argument, if any.</p></li>
 
    <li><p>If the <var title="">source port</var> is not entangled with
-   another port, then return false and abort these steps.</p></li>
+   another port, then return and abort these steps.</p></li>
    <!-- we don't raise an exception because this can happen moment's
-   notice, but we return false so that the caller can check whether
-   the port was active at time of calling without a race
-   condition. -->
+   notice. listen to onclose if you want to know when things start
+   going wonky. (We don't return false because if the port is _about_
+   to be closed, the message might not be listened for anyway.) -->
 
    <li><p>Let <var title="">target port</var> be the port with which
    <var title="">source port</var> is entangled.</p></li>
@@ -42461,7 +42461,7 @@
 
    </li>
 
-   <li><p>Return true from the method, but continue with these
+   <li><p>Return from the method, but continue with these
    steps.</p></li>
 
    <li><p>Add the event to the <span>port message queue</span> of <var
@@ -42489,16 +42489,29 @@
    <li><p>Let <var title="">message</var> be the method's first
    argument.</p></li>
 
+   <li><p><span>Create a new <code>MessagePort</code> object</span>
+   owned by the <span>script execution context</span>, and let <var
+   title="">port1</var> be that object.</p></li>
+
    <li><p>If the <var title="">source port</var> is not entangled with
-   another port, then return null and abort these steps.</p></li> <!--
-   we don't raise an exception because this can happen moment's
-   notice, but we return false so that the caller can check whether
-   the port was active at time of calling without a race
-   condition. -->
+   another port, then return <var title="">port1</var> and abort these
+   steps.</p></li>
+   <!-- we don't raise an exception because this can happen moment's
+   notice. listen to onclose if you want to know when things start
+   going wonky. (We don't return null because then we'd end up with
+   null derefs. better to just let the likely next postMessage call
+   fall on the floor) -->
 
    <li><p>Let <var title="">target port</var> be the port with which
    <var title="">source port</var> is entangled.</p></li>
 
+   <li><p><span>Create a new <code>MessagePort</code> object</span>
+   owned by the owner of the <var title="">target port</var>, and let
+   <var title="">port2</var> be that object.</p></li>
+
+   <li><p><span>Entangle</span> the <var title="">port1</var> and <var
+   title="">port2</var> objects.</p></li>
+
    <li><p>Create an event that uses the <code>MessageEvent</code>
    interface, with the name <code
    title="event-message">message</code>, which does not bubble, is
@@ -42507,17 +42520,6 @@
    <li><p>Let the <code title="dom-MessageEvent-data">data</code>
    attribute of the event have the value of <var
    title="">message</var>, the method's first argument.</p></li>
-
-   <li><p><span>Create a new <code>MessagePort</code> object</span>
-   owned by the <span>script execution context</span>, and let <var
-   title="">port1</var> be that object.</p></li>
-
-   <li><p><span>Create a new <code>MessagePort</code> object</span>
-   owned by the owner of the <var title="">target port</var>, and let
-   <var title="">port2</var> be that object.</p></li>
-
-   <li><p><span>Entangle</span> the <var title="">port1</var> and <var
-   title="">port2</var> objects.</p></li>
  
    <li><p>Let the <code
    title="dom-MessageEvent-messagePort">messagePort</code> attribute




More information about the Commit-Watchers mailing list