The library offers a common compatibility layer whatever the environment it runs on.
Standard object methods and statics
The Date constructor supports ISO 8601 format and instances offers:
Function.prototype.toString() does not include comments on Rhino.
Object.assignfails with Chakra if one parameter is
Object.keysdoesn't behave the same way on primitive types depending on the host.
NOTE: Only one string parameter is expected.
setInterval / clearInterval are not managed but can be easily simulated by chaining timeouts.
On some hosts, gpf.handleTimeout() must be used to activate timeouts.
When functions are generated, strict mode is always assumed even if the host (such as Rhino or WScript) does not support it.
When it comes to supporting custom verbs, some hosts are not working properly:
- PhantomJS does not even try to send the request.
- On JAVA hosts (Nashorn and Rhino), the method is validated and refused.
Since most of the above hosts are not maintained, no further research was conducted.
If one is looking for a workaround, the custom http header
X-HTTP-Method-Override seems to be