Subj : Re: "deprecated with statement usage" To : bmf1972@icqmail.com From : Igor Bukanov Date : Tue Oct 14 2003 04:46 pm Adrian Herscu wrote: > Why it is deprecated? > Is it safe to use it? > Does it have any hidden (or hardly to anticipate) behaviors? If x does not have the property y, then the following code with(x) { y = 10; } will not add a new property y to the object x and instead will define a new global variable y. But if the prototype object for x contains property y, then x will get y. Now consider maintenance nightmare when the object x or its prototype gain or lose properties. In addition "with" is very costly syntax sugar since its mere existence makes JavaScript implementation significantly more complex and prevents many possible optimizations. Regards, Igor. .