BTW, this can cause problems if sb have exported a `document`. I'm starting to think it should be:
`typeof window !== 'undefined' ? window : null`
the parameter should be just named `window` instead of `global` and in:
https://github.com/jquery/jquery/pull/1476/files#diff-f1ebe0c2ce0a72c9131e854556761642R25
that we should do:
`module.exports = window && window.document ?`

As it is in this PR we would somethimes get to the point where `this` being `module.exports` is passed and I can't think of a situation where that would be desirable.

cc @dmethvin