I'm currently in the process of porting env.js to Nashorn. While trying to run jQuery I discovered that the toString method in window.js (https://github.com/envjs/env-js/blob/master/envjs/window.js#L749) actually causes all objects to return '[Window]' when their toString method is called.
console.log(toString());
>>[Window]
console.log(toString.call("test"));
>>[Window]
var a = {};
console.log(a.toString());
>>[Window]
jQuery is unable to make ajax requests because the toString method is used when registering the transports (https://github.com/jquery/jquery/blob/master/src/ajax.js#L61). Since the toString method is broken, jQuery's "typeof" method will default to calling the transport functions objects which causes the "isFunction" check to fail, preventing any transports from being registered.
I'm currently in the process of porting env.js to Nashorn. While trying to run jQuery I discovered that the toString method in window.js (https://github.com/envjs/env-js/blob/master/envjs/window.js#L749) actually causes all objects to return '[Window]' when their toString method is called.
Chrome:
Nashorn + env:
jQuery is unable to make ajax requests because the toString method is used when registering the transports (https://github.com/jquery/jquery/blob/master/src/ajax.js#L61). Since the toString method is broken, jQuery's "typeof" method will default to calling the transport functions objects which causes the "isFunction" check to fail, preventing any transports from being registered.