This is a lot of code for saying `thisContext = window || global || self` (I get that there's the additional `window.window == window` trick, which I also wonder if is necessary.