From cc25d52e0f65d54c052908c7d91d5946342ab88a Mon Sep 17 00:00:00 2001 From: Sylvain Henry Date: Thu, 10 Feb 2022 08:24:24 +0000 Subject: 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 Co-authored-by: Luite Stegeman Co-authored-by: Josh Meredith --- rts/js/node-exports.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 rts/js/node-exports.js (limited to 'rts/js/node-exports.js') 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; +} + -- cgit v1.2.1