Exactly. I'm not saying those opts aren't legal, but in cases that look legal in C, they're not legal in JS. And note, you can still do it in the presence of a custom valueOf method, as long as it doesn't have side effects (and thus of course loop-invariant itself).
In essence I'm asking if Google does in fact do this check, and does analysis to ensure that the valueOf method doesn't get written dynamically in the loop itself.
In essence I'm asking if Google does in fact do this check, and does analysis to ensure that the valueOf method doesn't get written dynamically in the loop itself.