4 ms·
This has nothing to do with the DOM. There are existing server-side JS deployments that have no DOM, but do create separate globals per request. There is noth
by bzbarsky 15y ago
This has nothing to do with the DOM. There are existing server-side JS deployments that have no DOM, but do create separate globals per request.
There is nothing other than a conscious design decision that forces the Node code that you write to run against the same global as the code that handles the I/O guts in Node...
In particular, you could have the code that listens on the socket and chunks up the byte stream into HTTP requests running against one global while all further processing of those requests runs against a different global or set of globals. It's just that Node chose not to do that. But that's not an inherent limitation of either JS the language or the V8 implementation.