Fix SourceMap loading on Android

Reviewed By: martinbigio

Differential Revision: D2891405

fb-gh-sync-id: 8fa38e530952c6e7fda48557ea6386b4b456efb0
This commit is contained in:
Dave Miller 2016-02-02 12:20:36 -08:00 committed by facebook-github-bot-7
parent 656e992fa6
commit d1e9fc0737
1 changed files with 8 additions and 1 deletions

View File

@ -34,13 +34,20 @@ var SourceMapsUtils = {
.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 text = data.text;
const fullSourceMappingURL = data.fullSourceMappingURL;
if (fullSourceMappingURL) {
return fullSourceMappingURL;
}
var mapURL = SourceMapURL.getFrom(text);
if (!mapURL) {
return null;
}
if (!url) {
return null;
}
var baseURLs = url.match(/(.+:\/\/.*?)\//);
if (!baseURLs || baseURLs.length < 2) {
return null;