For any future googlers: global is window. So if you want to use the window object, don't use global.window — just use global.