Subj : Re: "for each" bug To : Jason From : Brendan Eich Date : Wed Apr 27 2005 11:23 am Jason wrote: >>Fixed. Thanks for reporting it. > > hmmm, I'm a little confused about what's going on & why an inner loop > would affect an outer loop... in js_interp.c, if that variable > "foreach" controls whether it's a "for each" loop vs. a "for" loop, and > it causes the problem I described, then isn't the bug that this state > variable should be stored on some kind of loop stack? No. It's needed only to propagate one bit of information from the JSOP_FOREACH prefix bytecode to the next bytecode after it. No loop can nest in between those two bytecodes, so a flag suffices. An alternative approach would store the last op every time through the loop, before setting op to the next operation bytecode, but that's costlier. /be .