Permalink
Browse files

guard against window globals not being defined, should work better on…

… older browsers and in webworkers
  • Loading branch information...
1 parent 88794ec commit 5c5496a66cf5264f6a309ec9b6e57aea57ac83d6 @substack committed Sep 24, 2014
Showing with 3 additions and 3 deletions.
  1. +3 −3 lib/request.js
View
@@ -203,7 +203,7 @@ var indexOf = function (xs, x) {
};
var isXHR2Compatible = function (obj) {
- return obj instanceof window.Blob
- || obj instanceof window.ArrayBuffer
- || obj instanceof window.FormData;
+ if (typeof Blob !== 'undefined' && obj instanceof Blob) return true;
+ if (typeof ArrayBuffer !== 'undefined' && obj instanceof ArrayBuffer) return true;
+ if (typeof FormData !== 'undefined' && obj instanceof FormData) return true;
};

0 comments on commit 5c5496a

Please sign in to comment.