[whatwg] SharedWorkers and the name parameter

Ian Hickson ian at hixie.ch
Tue Sep 1 16:47:40 PDT 2009


On Tue, 25 Aug 2009, Drew Wilson wrote:
> On Tue, Aug 25, 2009 at 4:24 PM, Ian Hickson <ian at hixie.ch> wrote:
> > On Tue, 18 Aug 2009, Drew Wilson wrote:
> > >
> > > An alternative would be to make the "name" parameter optional, where 
> > > omitting the name would create an unnamed worker that is 
> > > identified/shared only by its url.
> > >
> > > So pages would only specify the name in cases where they actually 
> > > want to have multiple instances of a shared worker.
> >
> > Done.
>
> Thanks for adding this, Ian. However, the resulting spec language is 
> subtly different from what I was proposing. Section 4.8.3 of the spec 
> now reads:
> 
> "4. Let name be the value of the second argument, or the value of 
> scriptURL, if the second argument was omitted."
> 
>  My reading of this is if I do the following:
> 
> var worker1 = new SharedWorker("http://www.example.com/worker", "
> http://www.example.com/worker2");
> 
> Then try to do this:
> 
> var worker2 = new SharedWorker("http://www.example.com/worker2");
> 
> The second invocation of the constructor would throw a URL_MISMATCH_ERR, 
> since the name "http://www.example.com/worker2" is already associated 
> with the script at "http://www.example.com/worker".

Yeah, good point. Ok, fixed.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'



More information about the whatwg mailing list