swallow SJAX errors during in-browser translation
This commit is contained in:
parent
313c03883e
commit
d722c97762
@ -95,16 +95,20 @@ function retrieveSourceMapURL(source) {
|
|||||||
var fileData;
|
var fileData;
|
||||||
|
|
||||||
if (isInBrowser()) {
|
if (isInBrowser()) {
|
||||||
var xhr = new XMLHttpRequest();
|
try {
|
||||||
xhr.open('GET', source, false);
|
var xhr = new XMLHttpRequest();
|
||||||
xhr.send(null);
|
xhr.open('GET', source, false);
|
||||||
fileData = xhr.readyState === 4 ? xhr.responseText : null;
|
xhr.send(null);
|
||||||
|
fileData = xhr.readyState === 4 ? xhr.responseText : null;
|
||||||
|
|
||||||
// Support providing a sourceMappingURL via the SourceMap header
|
// Support providing a sourceMappingURL via the SourceMap header
|
||||||
var sourceMapHeader = xhr.getResponseHeader("SourceMap") ||
|
var sourceMapHeader = xhr.getResponseHeader("SourceMap") ||
|
||||||
xhr.getResponseHeader("X-SourceMap");
|
xhr.getResponseHeader("X-SourceMap");
|
||||||
if (sourceMapHeader) {
|
if (sourceMapHeader) {
|
||||||
return sourceMapHeader;
|
return sourceMapHeader;
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user