forked from thatcher/env-js
-
Notifications
You must be signed in to change notification settings - Fork 20
Open
Description
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:
>toString()
"[object Window]"
>toString.call("test")
"[object String]"
>var a = {}
undefined
>a.toString()
"[object Object]"
Nashorn + env:
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.
Metadata
Metadata
Assignees
Labels
No labels