Comparing version 1.4.1 to 1.4.2
@@ -345,8 +345,23 @@ "use strict"; | ||
var parser = new DOMParser(); | ||
var parsererrors = parser | ||
.parseFromString("INVALID", "text/xml") | ||
.getElementsByTagName("parsererror"); | ||
var parsererrorNS = parsererrors.length | ||
? parsererrors[0].namespaceURI : ""; | ||
var result = parser.parseFromString(text, "text/xml"); | ||
var parsererrorNS = ""; | ||
try { | ||
var parsererrors = parser | ||
.parseFromString("INVALID", "text/xml") | ||
.getElementsByTagName("parsererror"); | ||
if (parsererrors.length) { | ||
parsererrorNS = parsererrors[0].namespaceURI; | ||
} | ||
} catch (e) { | ||
// passing invalid XML makes IE11 throw | ||
// so no namespace needs to be determined | ||
} | ||
var result; | ||
try { | ||
result = parser.parseFromString(text, "text/xml"); | ||
} catch (err) { | ||
return null; | ||
} | ||
return result.getElementsByTagNameNS(parsererrorNS, "parsererror").length | ||
@@ -353,0 +368,0 @@ ? null : result; |
{ | ||
"name": "nise", | ||
"version": "1.4.1", | ||
"version": "1.4.2", | ||
"description": "Fake XHR and server", | ||
@@ -53,3 +53,3 @@ "keywords": [ | ||
"mocha": "^5.0.0", | ||
"nyc": "^11.4.1", | ||
"nyc": "^13.0.0", | ||
"proxyquire": "^1.8.0", | ||
@@ -56,0 +56,0 @@ "sinon": "^4.2.2" |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
790321
8951