Use `global` instead of `window` to make npm tests pass.