提交 e3298525 编写于 作者: J Jake Champion

Detect if DOMException exists via typeof instead of trying to call it and...

Detect if DOMException exists via typeof instead of trying to call it and catching the exception which may get thrown

fixes https://github.com/github/fetch/issues/724
上级 a0dcd853
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册