Skip to content

Commit 5c5496a

Browse files
author
James Halliday
committed
guard against window globals not being defined, should work better on older browsers and in webworkers
1 parent 88794ec commit 5c5496a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/request.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ var indexOf = function (xs, x) {
203203
};
204204

205205
var isXHR2Compatible = function (obj) {
206-
return obj instanceof window.Blob
207-
|| obj instanceof window.ArrayBuffer
208-
|| obj instanceof window.FormData;
206+
if (typeof Blob !== 'undefined' && obj instanceof Blob) return true;
207+
if (typeof ArrayBuffer !== 'undefined' && obj instanceof ArrayBuffer) return true;
208+
if (typeof FormData !== 'undefined' && obj instanceof FormData) return true;
209209
};

0 commit comments

Comments
 (0)