A loop of "for each (let button in aButtons)" can be replaced by something like this:
- Code: Select all
for (let property in aButtons)
let button = buttons[property];
Slightly more clunky but equivalent and robust.
Depending on the exact situation, you may be able to just replace the for each ... in with for ... of. The for ... of construct also iterates over the values of the properties of aButtons, but it only works for certain types of object so you can't always just drop it in.
avada wrote:Thanks. Though it looks like it wasn't broken by this. I did a regression test and it popped up Bug 1317947 - Upgrade Firefox 53 to NSS 3.29.
Gah... As it turns out for each was the problem after all. It just eluded me that it's used twice... :facepalm: (I'm such a loser...)
Anyway thanks for the fix!
A lesson of this is to NEVER use mozregression. It's garbage. It pointed to two different irrelevant bugs at different times.