<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>16999</bug_id>
          
          <creation_ts>2012-05-08 19:31:00 +0000</creation_ts>
          <short_desc>Clarify JS type for empty close reason</short_desc>
          <delta_ts>2012-05-10 07:22:43 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebAppsWG</product>
          <component>WebSocket API (editor: Ian Hickson)</component>
          <version>unspecified</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>INVALID</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>minor</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Jason Duell">jduell.mcbugs</reporter>
          <assigned_to name="Ian &apos;Hixie&apos; Hickson">ian</assigned_to>
          <cc>jonas</cc>
    
    <cc>mike</cc>
    
    <cc>Ms2ger</cc>
    
    <cc>public-webapps</cc>
          
          <qa_contact>public-webapps-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>67494</commentid>
    <comment_count>0</comment_count>
    <who name="Jason Duell">jduell.mcbugs</who>
    <bug_when>2012-05-08 19:31:00 +0000</bug_when>
    <thetext>I don&apos;t believe the Web socket spec is clear on this:

If there is no close &apos;reason&apos; passed from the server in the protocol (which on a network frame level is different than sending an empty Unicode string), should we set the close event&apos;s &apos;reason&apos; field to &apos;undefined&apos;, or to an empty string?   Right now Firefox is setting it to an empty string.  Logically, I feel it ought to be &apos;undefined&apos;.  But I don&apos;t see much harm in it being an empty string.  Either way the spec should be clear about it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>67503</commentid>
    <comment_count>1</comment_count>
    <who name="Jonas Sicking (Not reading bugmail)">jonas</who>
    <bug_when>2012-05-08 21:04:09 +0000</bug_when>
    <thetext>Rather than undefined I think null would be more appropriate. But I&apos;d be ok either way.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>67522</commentid>
    <comment_count>2</comment_count>
    <who name="Ms2ger">Ms2ger</who>
    <bug_when>2012-05-09 17:07:31 +0000</bug_when>
    <thetext>&gt; The reason attribute must return the value it was initialized to.
&gt; When the object is created, this attribute must be initialized to
&gt; empty string.

What&apos;s unclear? (Except for the missing &apos;the&apos;)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>67524</commentid>
    <comment_count>3</comment_count>
    <who name="Jason Duell">jduell.mcbugs</who>
    <bug_when>2012-05-09 20:59:12 +0000</bug_when>
    <thetext>&gt; attribute must be initialized to empty string.

Ah, didn&apos;t see that.  So the spec is clear then--&apos;reason&apos; will never be null/undefined.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>67542</commentid>
    <comment_count>4</comment_count>
    <who name="Simon Pieters">zcorpan</who>
    <bug_when>2012-05-10 07:22:43 +0000</bug_when>
    <thetext>I think this is the relevant part

&quot;whose reason attribute is initialized to the WebSocket connection close reason decoded as UTF-8, with error handling, and dispatch the event at the WebSocket object. [WSP]&quot;

and then WSP says

&quot;If there is no such data in the Close control frame, _The WebSocket Connection Close Reason_ is the empty string.&quot;

But the result is the same. :-)</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>