swallow SJAX errors during in-browser translation

This commit is contained in:
Pablo Alonso Garcia 2016-12-14 13:50:53 +01:00
parent 313c03883e
commit d722c97762

View File

@ -95,6 +95,7 @@ function retrieveSourceMapURL(source) {
var fileData; var fileData;
if (isInBrowser()) { if (isInBrowser()) {
try {
var xhr = new XMLHttpRequest(); var xhr = new XMLHttpRequest();
xhr.open('GET', source, false); xhr.open('GET', source, false);
xhr.send(null); xhr.send(null);
@ -106,6 +107,9 @@ function retrieveSourceMapURL(source) {
if (sourceMapHeader) { if (sourceMapHeader) {
return sourceMapHeader; return sourceMapHeader;
} }
} catch (e) {
return null;
}
} }
// Get the URL of the source map // Get the URL of the source map