diff options
author | Sylvain Henry <sylvain@haskus.fr> | 2022-02-10 08:24:24 +0000 |
---|---|---|
committer | Sylvain Henry <sylvain@haskus.fr> | 2022-11-29 09:44:31 +0100 |
commit | cc25d52e0f65d54c052908c7d91d5946342ab88a (patch) | |
tree | 0f35764ee3b9b0451ac999b64d2db9fa074fa3dd /rts/js/node-exports.js | |
parent | def47dd32491311289bff26230b664c895f178cc (diff) | |
download | haskell-cc25d52e0f65d54c052908c7d91d5946342ab88a.tar.gz |
Add Javascript backend
Add JS backend adapted from the GHCJS project by Luite Stegeman.
Some features haven't been ported or implemented yet. Tests for these
features have been disabled with an associated gitlab ticket.
Bump array submodule
Work funded by IOG.
Co-authored-by: Jeffrey Young <jeffrey.young@iohk.io>
Co-authored-by: Luite Stegeman <stegeman@gmail.com>
Co-authored-by: Josh Meredith <joshmeredith2008@gmail.com>
Diffstat (limited to 'rts/js/node-exports.js')
-rw-r--r-- | rts/js/node-exports.js | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/rts/js/node-exports.js b/rts/js/node-exports.js new file mode 100644 index 0000000000..a8d2db82a5 --- /dev/null +++ b/rts/js/node-exports.js @@ -0,0 +1,19 @@ +// add exported things to global again, run this after all node modules +/* +var h$glbl = this; +for(p in exports) { +// console.log("exporting: " + p); +// console.log("type: " + (typeof this[p])); + if(typeof this[p] === 'undefined') { + h$glbl[p] = exports[p]; + } +} +*/ +if(typeof exports !== 'undefined') { + if(typeof WeakMap === 'undefined' && typeof global !== 'undefined') { + global.WeakMap = exports.WeakMap; + } +// var Map = exports.Map; +// var Set = exports.Set; +} + |