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

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>94310</bug_id>
          
          <creation_ts>2012-08-17 01:09:19 -0700</creation_ts>
          <short_desc>[JSC] window.postMessage() throws wrong exception types</short_desc>
          <delta_ts>2012-09-03 01:09:59 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebCore JavaScript</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc>http://www.w3.org/TR/html5/comms.html#dom-window-postmessage-2</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          <dependson>94493</dependson>
    
    <dependson>94581</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Chris Dumez">cdumez</reporter>
          <assigned_to name="Chris Dumez">cdumez</assigned_to>
          <cc>kenneth</cc>
    
    <cc>s.choi</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>698011</commentid>
    <comment_count>0</comment_count>
    <who name="Chris Dumez">cdumez</who>
    <bug_when>2012-08-17 01:09:19 -0700</bug_when>
    <thetext>According the HTML5 communication spec (http://www.w3.org/TR/html5/comms.html#dom-window-postmessage-2), window.postMessage() &quot;Throws an INVALID_STATE_ERR if the ports array is not null and it contains either null entries or duplicate ports.&quot; but we currently throw a TypeError in this case.

According to the structured clone spec (http://www.w3.org/TR/html5/common-dom-interfaces.html#structured-clone), we are supposed to throw a DATA_CLONE_ERR exception and abort the overall structured clone algorithm if the input is an unsupported native object type (e.g. Error, Function) or a host object (e.g. a DOM node). We currently throw a TypeError in this case as well.

The V8 implementation behaves according to specification.

This is already tested by:
  fast/dom/Window/window-postmessage-clone-really-deep-array.html
  fast/events/message-port-multi.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>710467</commentid>
    <comment_count>1</comment_count>
    <who name="Chris Dumez">cdumez</who>
    <bug_when>2012-09-03 01:09:59 -0700</bug_when>
    <thetext>Dependencies have landed. Closing this bug.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>