title: Passing objects to a web worker
body: <p>I'm trying to pass an object to a web worker through the postMessage function.<br>
  This object is a square that has a couple of functions to draw himself on a canvas and some other things.  The web worker must return an array of this objects.<br>
  The problem is that when I call the postMessage function with this object, I get an this error:</p>
  
  <pre><code>Uncaught Error: DATA_CLONE_ERR: DOM Exception 25
  </code></pre>
  
  <p>I get this both sending the object to the worker and the other way around.<br>
  I think the error is because javascript must serialize the object, but can't do it because the object has functions built-in.</p>
  
  <p>Does anyone ever had a similar problem? Do you know some workarround to this?<br>
  Thanks in advance.</p>