Comment 4 for bug 1648649

Revision history for this message
Daniel Holbert (dholbert) wrote :

Great, thanks Chris!

Note: I am not a JS expert, so my suggested replacement in comment 0 might not be exactly right for all cases of this pattern. (I believe it's correct for code that's iterating over a JS array, but the semantics might be slightly different for other structures, e.g. whether you're iterating over keys vs. values, etc. This definitely merits a sanity-check test (e.g. logging each iterated entry before/after the change) to be sure the conversion is valid.)