Conversation
| $emval_get_global: function() { | ||
| if (typeof globalThis === 'object') { | ||
| return globalThis; | ||
| } |
There was a problem hiding this comment.
When was this introduced? Can we assume globalThis is we are building for wasm and ifdef out the fallback case perhaps?
There was a problem hiding this comment.
this meaning this usage of new Function and return this? I think it's part of core embind, so pretty old I imagine.
I don't think we can assume globalThis if wasm is present. E.g. node.js 8.9.1 (emsdk default) has wasm but not globalThis, which appears to be fairly new.
There was a problem hiding this comment.
globalThis is available in V8 v7.1 / Chrome 71, Firefox 65, Safari 12.1, and Node.js v12.
There was a problem hiding this comment.
Thanks mathias. I guess that means as soon node v12 or above is LTS we can remove the legacy code.
We could consider depending on a more recent version of node than LTS? I guess we have two uses of node in emscripten:
- Emscripten developers who need to run the test suite
- Node users who want to put wasm in their node modules.
For (1) we can choose whatever version of node we want. But for (2) its probably good to have continue to support LTS I guess?
There was a problem hiding this comment.
I agree that following LTS makes sense for use case 2.
It would be useful to codify the supported Node.js version in the repository by adding an .nvmrc file to the root, and a notice to the readme.
As reported on the mailing list, this is much faster in some VMs and also has other benefits, https://groups.google.com/d/msg/emscripten-discuss/6hnm_tJJ018/irC5BLEvCAAJ
As reported on the mailing list, this is much faster in some VMs and also has other benefits,
https://groups.google.com/d/msg/emscripten-discuss/6hnm_tJJ018/irC5BLEvCAAJ