Skip to content

Commit

Permalink
Detect if DOMException exists via typeof instead of trying to call it…
Browse files Browse the repository at this point in the history
… and catching the exception which may get thrown

fixes #724
  • Loading branch information
JakeChampion committed Jul 9, 2020
1 parent a0dcd85 commit e329852
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions fetch.js
Expand Up @@ -455,9 +455,8 @@ Response.redirect = function(url, status) {
}

export var DOMException = global.DOMException
try {
new DOMException()
} catch (err) {

if (typeof DOMException !== 'function') {
DOMException = function(message, name) {
this.message = message
this.name = name
Expand Down

0 comments on commit e329852

Please sign in to comment.