<?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>15094</bug_id>
          
          <creation_ts>2011-12-07 00:57:42 +0000</creation_ts>
          <short_desc>When creating a worker, it should be possible to assign some arguments to the constructor, or pass an init object like so: var worker = new Worker(&quot;someurl.js&quot;, { someData: &quot;1234&quot; }); The object passed could be made available as the current context (this.</short_desc>
          <delta_ts>2011-12-14 00:22:12 +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>Web Workers (editor: Ian Hickson)</component>
          <version>unspecified</version>
          <rep_platform>Other</rep_platform>
          <op_sys>other</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WONTFIX</resolution>
          
          
          <bug_file_loc>http://www.whatwg.org/specs/web-apps/current-work/#top</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P3</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>contributor</reporter>
          <assigned_to name="Ian &apos;Hixie&apos; Hickson">ian</assigned_to>
          <cc>ian</cc>
    
    <cc>jonas</cc>
    
    <cc>mike</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>61072</commentid>
    <comment_count>0</comment_count>
    <who name="">contributor</who>
    <bug_when>2011-12-07 00:57:42 +0000</bug_when>
    <thetext>Specification: http://www.w3.org/TR/workers/
Multipage: http://www.whatwg.org/C#top
Complete: http://www.whatwg.org/c#top

Comment:
When creating a worker, it should be possible to assign some arguments to the
constructor, or pass an init object like so:

var worker = new Worker(&quot;someurl.js&quot;, { someData: &quot;1234&quot; });

The object passed could be made available as the current context
(this.someData) or as a global variable with a predefined name.


Posted from: 84.48.203.37
User agent: Mozilla/5.0 (iPad; U; CPU OS 4_2_1 like Mac OS X; nb-no) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8C148 Safari/6533.18.5</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>61078</commentid>
    <comment_count>1</comment_count>
    <who name="Jonas Sicking (Not reading bugmail)">jonas</who>
    <bug_when>2011-12-07 01:16:19 +0000</bug_when>
    <thetext>Oooh, I like this idea.

Basically it&apos;s syntax sugar for creating a worker and then posting a message to it. But it allows the data to be there while the initial worker body is running which is nice.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>61351</commentid>
    <comment_count>2</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2011-12-09 23:08:37 +0000</bug_when>
    <thetext>This saves like 3 lines of code, is it really that helpful?

var worker = new Worker(&quot;someurl.js&quot;);
worker.postMessage({somData: &quot;1234&quot;});

// someurl.js:
onmessage = function (event.data) {
  // whatever your worker would have been;
  // initial data is in event.data
}</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>61513</commentid>
    <comment_count>3</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2011-12-14 00:22:12 +0000</bug_when>
    <thetext>Doesn&apos;t seem compelling. Please don&apos;t hesitate to reopen if I&apos;ve missed something obvious here.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>