[whatwg] Passing more than JSON data to workers

Boris Zbarsky bzbarsky at MIT.EDU
Wed Dec 16 13:47:46 PST 2009


On 12/16/09 1:27 PM, Jan Fabry wrote:
>> function setFoo(val) { foo = val; }
>> function getFoo() { return foo; }
...
> After the second postMessage, the worker receives a new object, also a function, bound to a variable with the value 1.

What if getFoo were:

   function getFoo() { return this["foo"]; }

What if it were:

   function getFoo() { return this["fo" + "o"]; }

What about:

   var o = "o";
   function getFoo() { return this["fo" + o]; }

?

Maybe a better question is: What problem are you trying to solve?

-Boris



More information about the whatwg mailing list