Bug 1523528 - [release 122] Don't wait to load already-loaded source maps (#7819). r=dwalsh

This commit is contained in:
Brian Hackett 2019-01-30 17:36:21 -05:00 committed by Jason Laster
parent 9256725d3c
commit 9a8e529067
3 changed files with 29 additions and 2 deletions

View File

@ -23149,6 +23149,7 @@ const dispatcher = new WorkerDispatcher();
const setAssetRootURL = dispatcher.task("setAssetRootURL");
const getOriginalURLs = dispatcher.task("getOriginalURLs");
const hasOriginalURL = dispatcher.task("hasOriginalURL");
const getOriginalRanges = dispatcher.task("getOriginalRanges");
const getGeneratedRanges = dispatcher.task("getGeneratedRanges", {
queue: true
@ -23175,6 +23176,7 @@ module.exports = {
isOriginalId,
hasMappedSource,
getOriginalURLs,
hasOriginalURL,
getOriginalRanges,
getGeneratedRanges,
getGeneratedLocation,

View File

@ -438,6 +438,7 @@ const dispatcher = new WorkerDispatcher();
const setAssetRootURL = dispatcher.task("setAssetRootURL");
const getOriginalURLs = dispatcher.task("getOriginalURLs");
const hasOriginalURL = dispatcher.task("hasOriginalURL");
const getOriginalRanges = dispatcher.task("getOriginalRanges");
const getGeneratedRanges = dispatcher.task("getGeneratedRanges", {
queue: true
@ -464,6 +465,7 @@ module.exports = {
isOriginalId,
hasMappedSource,
getOriginalURLs,
hasOriginalURL,
getOriginalRanges,
getGeneratedRanges,
getGeneratedLocation,

View File

@ -1872,6 +1872,7 @@ exports.ArraySet = ArraySet;
* file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
const {
getOriginalURLs,
hasOriginalURL,
getOriginalRanges,
getGeneratedRanges,
getGeneratedLocation,
@ -1896,6 +1897,7 @@ const {
self.onmessage = workerHandler({
setAssetRootURL,
getOriginalURLs,
hasOriginalURL,
getOriginalRanges,
getGeneratedRanges,
getGeneratedLocation,
@ -1931,7 +1933,11 @@ const { SourceMapConsumer, SourceMapGenerator } = __webpack_require__(3705);
const { createConsumer } = __webpack_require__(3793);
const assert = __webpack_require__(3717);
const { fetchSourceMap } = __webpack_require__(3718);
const {
fetchSourceMap,
hasOriginalURL,
clearOriginalURLs
} = __webpack_require__(3718);
const {
getSourceMap,
setSourceMap,
@ -2240,10 +2246,12 @@ function applySourceMap(generatedId, url, code, mappings) {
function clearSourceMaps() {
clearSourceMapsRequests();
clearWasmXScopes();
clearOriginalURLs();
}
module.exports = {
getOriginalURLs,
hasOriginalURL,
getOriginalRanges,
getGeneratedRanges,
getGeneratedLocation,
@ -3955,6 +3963,17 @@ const { SourceMapConsumer } = __webpack_require__(3705);
const { convertToJSON } = __webpack_require__(3785);
const { createConsumer } = __webpack_require__(3793);
// URLs which have been seen in a completed source map request.
const originalURLs = new Set();
function clearOriginalURLs() {
originalURLs.clear();
}
function hasOriginalURL(url) {
return originalURLs.has(url);
}
function _resolveSourceMapURL(source) {
const { url = "", sourceMapURL = "" } = source;
@ -3997,6 +4016,10 @@ async function _resolveAndFetch(generatedSource) {
}
}
if (map && map.sources) {
map.sources.forEach(url => originalURLs.add(url));
}
return map;
}
@ -4026,7 +4049,7 @@ function fetchSourceMap(generatedSource) {
return req;
}
module.exports = { fetchSourceMap };
module.exports = { fetchSourceMap, hasOriginalURL, clearOriginalURLs };
/***/ }),