inexorabletash/polyfill

Rhino Support

MichaelLeeHobbs opened this issue · 0 comments

General comment. I was able to get this working in Mirth Connect which runs JS on top of Rhino with the following changes.

Starting with: https://github.com/inexorabletash/polyfill/blob/master/polyfill.js as the base I made the following changes.

At the start, above the line // Composited file - DO NOT EDIT I added

self = this
console = {
	assert: (test,msg)=> {
		if (!test) logger.error(msg)
	}
}

Then I had to change the line global.Response = Response; to if (!global.Response) global.Response = Response;

I have not fully tested the polyfills but many of them I have confirmed working. For example Map and Array.from. I have doubts that Fetch will work and would likely need a custom polyfill for Mirth/Rhino.