Am I right in thinking that the javascript /* "use strict" */ construct would have caught this mistake (just like it would have done for me in perl code)? Seems to me that some such feature is absolutely and utterly necessary in any environment where you're doing a lot of closure creation ..
> var initial = 'string';
> "use strict"; (function(){ initial = 'anotherstring' })();
> initial
'anotherstring'
>