Crazy JavaScript error with smaller ribbons

So I had a really scary JavaScript error the other day when I tried to open the ribbon in a narrow browser window. I was testing scaling on some other components and happened to glance at the console only to see this:

At the same time the entire tab …