Neither did I. The vm stuff appeared in a search for "node new v8 process"
or similar.

Shame it has the odd behaviour with "this" and "prototype".
On 13 Jan 2014 21:42, "Pascal Hartig" <notifications@github.com> wrote:

> In server.js:
>
> > +    // http://nodejs.org/api/vm.html#vm_sandboxes
> > +    // This recovers from:
> > +    // a) The lack of prototype use
> > +    // b) The loss of 'this' context
> > +    for (var key in worker) {
> > +        if (worker.hasOwnProperty(key)) continue;
> > +
> > +        if (worker[key].bind) {
> > +            worker[key] = worker[key].bind(worker);
> > +        }
> > +        else {
> > +            worker[key] = worker[key];
> > +        }
> > +    }
> > +
> > +    vm.runInNewContext(expandedWorkerBody, worker, workerUrl);
>
> That's really cool. I didn't know about that.
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/phuu/serviceworker-demo/pull/49/files#r8841699>
> .
>