зеркало из https://github.com/github/fetch.git
Export DOMException for `instanceof` checks
This commit is contained in:
Родитель
f03586047c
Коммит
2bd7f22032
2
fetch.js
2
fetch.js
|
@ -424,7 +424,7 @@ Response.redirect = function(url, status) {
|
|||
return new Response(null, {status: status, headers: {location: url}})
|
||||
}
|
||||
|
||||
var DOMException = self.DOMException
|
||||
export var DOMException = self.DOMException
|
||||
try {
|
||||
new DOMException()
|
||||
} catch (err) {
|
||||
|
|
|
@ -1060,6 +1060,7 @@ exercise.forEach(function(exerciseMode) {
|
|||
assert.ok(false)
|
||||
},
|
||||
function(error) {
|
||||
assert.instanceOf(error, WHATWGFetch.DOMException)
|
||||
assert.equal(error.name, 'AbortError')
|
||||
}
|
||||
)
|
||||
|
|
Загрузка…
Ссылка в новой задаче