提交 5426561f 编写于 作者: M Mislav Marohnić

Check `support.blob` as prerequisite for `response.arrayBuffer()`

This is opposed to checking for native ArrayBuffer because the polyfill
will only define `arrayBuffer()` methods if Blob is available.
上级 4a5079dd
......@@ -497,7 +497,7 @@ suite('Response', function() {
})
})
featureDependent(test, support.arrayBuffer, 'clone blob response', function() {
featureDependent(test, support.blob, 'clone blob response', function() {
return fetch('/binary').then(function(response) {
return Promise.all([response.clone().arrayBuffer(), response.arrayBuffer()]).then(function(bufs){
bufs.forEach(function(buf){
......@@ -530,7 +530,7 @@ suite('Response', function() {
// https://fetch.spec.whatwg.org/#body-mixin
suite('Body mixin', function() {
featureDependent(suite, support.arrayBuffer, 'arrayBuffer', function() {
featureDependent(suite, support.blob, 'arrayBuffer', function() {
test('resolves arrayBuffer promise', function() {
return fetch('/hello').then(function(response) {
return response.arrayBuffer()
......@@ -577,7 +577,6 @@ suite('Body mixin', function() {
test('rejects arrayBuffer promise after body is consumed', function() {
return fetch('/hello').then(function(response) {
assert(response.arrayBuffer, 'Body does not implement arrayBuffer')
assert.equal(response.bodyUsed, false)
response.blob()
assert.equal(response.bodyUsed, true)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册