It seems to me that we have to distinguish between *having node in the 
environment* and *being in a node environment*. The following changes to 
Emscripten will facilitate this:

in shell.js:

  ENVIRONMENT_HAS_NODE = typeof process === 'object' && typeof require === 
'function';
  ENVIRONMENT_IS_NODE = ENVIRONMENT_HAS_NODE && !ENVIRONMENT_IS_WEB && 
!ENVIRONMENT_IS_WORKER;

and in library_nodefs.js:

    mount: function (mount) {
      assert(ENVIRONMENT_HAS_NODE);
      return NODEFS.createNode(null, '/', NODEFS.getMode(mount.opts.root), 
0);
    },

Once I verify that this does exactly what I need, I'll submit a PR.

-- 
You received this message because you are subscribed to the Google Groups 
"emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/emscripten-discuss/ad678fcc-6e1c-4871-a560-85be63a83e8f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to