diff --git a/fetch.js b/fetch.js index 3fb6c5fc..279373c7 100644 --- a/fetch.js +++ b/fetch.js @@ -251,6 +251,14 @@ return Promise.resolve(new Blob([this._bodyText])) } } + + this.arrayBuffer = function() { + if (this._bodyArrayBuffer) { + return consumed(this) || Promise.resolve(this._bodyArrayBuffer) + } else { + return this.blob().then(readBlobAsArrayBuffer) + } + } } this.text = function() { @@ -270,16 +278,6 @@ } } - if (support.arrayBuffer) { - this.arrayBuffer = function() { - if (this._bodyArrayBuffer) { - return consumed(this) || Promise.resolve(this._bodyArrayBuffer) - } else { - return this.blob().then(readBlobAsArrayBuffer) - } - } - } - if (support.formData) { this.formData = function() { return this.text().then(decode)