These checks have to stay using typeof.  In legacy browsers where ArrayBuffer is undefined, it will also be undeclared, making it crash anyway.