Fix SourceMap loading on Android
Reviewed By: martinbigio Differential Revision: D2891405 fb-gh-sync-id: 8fa38e530952c6e7fda48557ea6386b4b456efb0
This commit is contained in:
parent
656e992fa6
commit
d1e9fc0737
|
@ -34,13 +34,20 @@ var SourceMapsUtils = {
|
||||||
.then(map => new SourceMapConsumer(map));
|
.then(map => new SourceMapConsumer(map));
|
||||||
},
|
},
|
||||||
|
|
||||||
extractSourceMapURL(data: ({url:string, text:string})): ?string {
|
extractSourceMapURL(data: ({url?:string, text?:string, fullSourceMappingURL?:string})): ?string {
|
||||||
const url = data.url;
|
const url = data.url;
|
||||||
const text = data.text;
|
const text = data.text;
|
||||||
|
const fullSourceMappingURL = data.fullSourceMappingURL;
|
||||||
|
if (fullSourceMappingURL) {
|
||||||
|
return fullSourceMappingURL;
|
||||||
|
}
|
||||||
var mapURL = SourceMapURL.getFrom(text);
|
var mapURL = SourceMapURL.getFrom(text);
|
||||||
if (!mapURL) {
|
if (!mapURL) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
if (!url) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
var baseURLs = url.match(/(.+:\/\/.*?)\//);
|
var baseURLs = url.match(/(.+:\/\/.*?)\//);
|
||||||
if (!baseURLs || baseURLs.length < 2) {
|
if (!baseURLs || baseURLs.length < 2) {
|
||||||
return null;
|
return null;
|
||||||
|
|
Loading…
Reference in New Issue