This project is archived and is in readonly mode.
Global object in CommonJS environments
In 1.3.1 we changed our function closures to use
.call(this) because the global
refers to the global scope. This change was necessary because in
ES5 strict and some other environments (JScript something)
this inside of a function with no context applied is
In NodeJS the global this in a file refers to the
exports object, rather than the global object. So in
1.3.1 NodeJS is currently broken.
Comments and changes to this ticket
It is based on blog posts by @kangax (PrototypeJS developer). He thoroughly explains the reasons on why this specific method is used and it makes total sense. I would like to use Tim's commit for 1.3.2.
Another fix could be to store a reference the global context somewhere, and
.callthe closures with it as argument, but I don't see an advantage over
A less desirable fix for most environments (but in turn breaking JScript again) would be to revert the