First things first: target/host env is quite rare and weird at same time, so I am OK if this ends with nothing. Pls excuse me in advance for time you might spent on it.
A plot: my friend and I come up with a "plugin" (JS code) for some win32 app to process previously recorded analog signal from injector(s) of you car to analyze it and find (best) approaches for driving your car (max speed (real vs stock), max RPM, max fuel consumption, RPM with best consumption, etc). I wrote it several years ago (based on knowledge/experience I had at that time. Means script was written with help of tech stack ~10y ago). Because of the env I ended with own implementations of logger, profiler, i18n engine, etc.
Platform: its a win32 app (quite old, ~MSWinXP) which is able to process recorded data with plugins. I pretty much sure it does not support anything except es3 (no, 'map', 'reduce', 'forEach', etc). For everyone interested in playing with it there will be a link to it.
My target: JS -> TS, grunt -> webpack, build inclusion order -> ES modules (import/export), home cooked modules -> NPM alternatives and so on..
Actual task: I am trying to import core-js package to fullfill missed stuff and faced with issue that https://github.com/zloirock/core-js/blob/master/packages/core-js/internals/global.js is not able to properly detect/find global object.
That file bring me to next links:
- https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
- How to get the global object in JavaScript?
- Getting a reference to the global object in an unknown environment in strict mode
- Is there an environment-agnostic way to detect Javascript Host Objects?
I believe I tried all suggestion (https://gist.github.com/ZuBB/017c40f4d68396428458660e6604f765) from those links but that does not help - https://drive.google.com/open?id=1XdQpryaOsJ2CFdF0Qh5c1u6GvPkJAIAl.
I would be grateful for any ideas how to get the reference to global object
gist with platform-related links: https://gist.github.com/ZuBB/7e3e76c7629518671e209148fc0d2b6a