Closed 0x4a616e closed 11 years ago
Thanks for your report! I can reproduce this bug and will look into it as soon as I find time.
I'm not claiming to be Ruby-literate here, but I guess this bug might might be more gracefully fixed upstream in visit_ForNode() in https://github.com/tenderlove/rkelly/blob/master/lib/rkelly/visitors/ecma_visitor.rb if I read how it deals with the init part of for loops.
RKelly handles for nodes correctly, this bug was introduced in the monkey patch code of JSDetox. I will commit a fix within a few minutes...
JavaScript in for loops can get invalid after reformatting or during analysis:
will be changed to