From d1e9fc0737fc0987436807d3b9992869f51ce078 Mon Sep 17 00:00:00 2001 From: Dave Miller Date: Tue, 2 Feb 2016 12:20:36 -0800 Subject: [PATCH] Fix SourceMap loading on Android Reviewed By: martinbigio Differential Revision: D2891405 fb-gh-sync-id: 8fa38e530952c6e7fda48557ea6386b4b456efb0 --- .../Initialization/SourceMapsUtils.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Libraries/JavaScriptAppEngine/Initialization/SourceMapsUtils.js b/Libraries/JavaScriptAppEngine/Initialization/SourceMapsUtils.js index f49a107c1..ecd6d8272 100644 --- a/Libraries/JavaScriptAppEngine/Initialization/SourceMapsUtils.js +++ b/Libraries/JavaScriptAppEngine/Initialization/SourceMapsUtils.js @@ -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;