ES5 and function default scope
This is just a quick one. One of the worst decision about ES5, after the one to remove arguments.callee when "use strict" is present, is the missed default reference to the global object. Probably the most secure trick to retrieve the native window in JavaScript is this one: // wherever we are var global = function(){return this}(); // while window, could be simply a variable // assigned somewhere else in this scope I have already talked about this, and I am still against some ES5 "feature" which aim is probably the one to make JavaScript as fast as possible, regardless all code that will break if "use strict" is present in the generic scope. Another non-sense is to allow a this in a context where there is no this. Rather than an error, ES5 will point refer this to undefined . Are you kidding me? this is a special keywords related to the context and you are telling me a context is undefined? so I guess open() , as example, should throw an error there, s...