title: Web workers without a separate Javascript file?
body: <p>As far as I can tell, web workers need to be written in a separate JavaScript file, and called like this: </p>
  
  <pre><code>new Worker('longrunning.js')
  </code></pre>
  
  <p>I'm using the closure compiler to combine and minify all my JavaScript source code, and I'd rather not have to have my workers in separate files for distribution. Is there some way to do this?</p>
  
  <pre><code>new Worker(function() {
      //Long-running work here
  });
  </code></pre>
  
  <p>Given that first-class functions are so crucial to JavaScript, why does the standard way to do background work have to load a whole other JavaScript file from the web server?</p>