Fix "document is not defined" error by diegohaz · Pull Request #835 · shipshapecode/tether

@rwwagner90 That will not fix the error as document will still be referenced in isUndefined(document). This isUndefined function can only be used with variables that already have been declared (so it returns true when their value is really undefined or they haven't been assigned a value yet).

It's not specific to document or window. Any variable that hasn't been declared will throw this error:

image

typeof is a special operator that bypasses this error:

image