Hi all,

Recently while reading through the ECMAScript standard, I came across the with keyword, which essentially seems to change the scope within it to whatever you pass to it. For example,

Code:
function FooBar(){}
with(FooBar.prototype){
   doSomething = function(){
       return 2;
   }
}

var f = new FooBar();
alert(f.doSomething()); // alerts "2"
My question is... is there any drawback to using it if you know not to use anything that could be in the global scope inside of it? Because that is all I was able to find so far... that there is no guarantee that it will use the locally scope variable if one with the same name exists in the global scope.

I did find a blog post saying it was being deprecated, but the blog post did not list any references so I have no idea if this is true or just rumors.

Thanks,
James