From 0ebc09524f285a08addea61819e2e8627e875fae Mon Sep 17 00:00:00 2001 From: Jake Champion Date: Thu, 30 Jul 2020 23:44:36 +0100 Subject: [PATCH] Revert "Detect if DOMException exists via typeof instead of trying to call it and catching the exception which may get thrown" This reverts commit e3298525e485a751e92456696ffa0634be98c8fd. --- fetch.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fetch.js b/fetch.js index 53c509d..b695d15 100644 --- a/fetch.js +++ b/fetch.js @@ -462,8 +462,9 @@ Response.redirect = function(url, status) { } export var DOMException = global.DOMException - -if (typeof DOMException !== 'function') { +try { + new DOMException() +} catch (err) { DOMException = function(message, name) { this.message = message this.name = name -- GitLab