"Krinkle" posted a comment on MediaWiki.r105619.
URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/105619#c28683

Commit summary for MediaWiki.r105619:

Update jquery.effects

Krinkle's comment:

It's upstream, but we do it as well. It ensures "undefined" is undefined 
because unfortunately JavaScript allows a variable to be named "undefined", 
both locally and globally. So if anywhere down the line between global scope 
and here someone thought it would be funny to do that, there's a problem. I 
think this is rather far fetched, but people seem to do it quite often 
(especially in plugins and frameworks that need to work "everywhere").

Another minor advantage (not a justification for this thought) is the scope. 
Normally "undefined" is global variable set to undefined, now it is a local 
variable instead of a global variable, which might speed up scripts that do a 
lot of comparisons which would otherwise have to bubble up the scope chain for 
each time "undefined" is referenced.

_______________________________________________
MediaWiki-CodeReview mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview

Reply via email to