Please explain what hack is used here (I can see that null is passed as a context to a function returning a property of it’s context. So I can’t clearly understand what is actually happening here.
function getGlobal(){
return (function(){
return this.dust;
}).call(null);
}
Setting the context to null will make
thispointing to the global object. So the code provided will act as accessing thedustproperty of the global object.According to the specification of ECMA 262 v5, 10.4.3 Entering Function Code
see http://es5.github.com/#x10.4.3