This is needed for node compatibility; there are many places dependent
on window being the true window, not just the global object. We don't
actually need node's global object inside the closure, it's exported
using module.exports anyway.
Pass window, not this to the main IIFE. Fixes #13760.
What happens when "window" is undefined?
It breaks at the beginning then (location = window.location). But aren't we screwed then anyway? Are there cases where we'd like to work without window?
location = window.location
If that's the case, I can always change window to window || this.
window || this
Seems like this is right. jQuery won't work without the DOM.
Yup, that's what I thought. So it should be OK then.
Why was it changed to this in the first place?
For the reason I said above, but I prefer the approach here anyway.
Fixes #13760. Pass window, not this to the main IIFE. Closes gh-1238