worker.js (1425B)
1 /* This Source Code Form is subject to the terms of the Mozilla Public 2 * License, v. 2.0. If a copy of the MPL was not distributed with this 3 * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */ 4 5 "use strict"; 6 7 importScripts("resource://gre/modules/workers/require.js"); 8 9 const { 10 getOriginalURLs, 11 hasOriginalURL, 12 getOriginalRanges, 13 getGeneratedRanges, 14 getGeneratedLocation, 15 getOriginalLocation, 16 getOriginalLocations, 17 getOriginalSourceText, 18 getGeneratedRangesForOriginal, 19 getFileGeneratedRange, 20 loadSourceMap, 21 clearSourceMaps, 22 setSourceMapForGeneratedSources, 23 clearSourceMapForGeneratedSources, 24 } = require("resource://devtools/client/shared/source-map-loader/source-map.js"); 25 26 const { 27 getOriginalStackFrames, 28 } = require("resource://devtools/client/shared/source-map-loader/utils/getOriginalStackFrames.js"); 29 30 const { 31 workerHandler, 32 } = require("resource://devtools/client/shared/worker-utils.js"); 33 34 // The interface is implemented in source-map to be 35 // easier to unit test. 36 self.onmessage = workerHandler({ 37 getOriginalURLs, 38 hasOriginalURL, 39 getOriginalRanges, 40 getGeneratedRanges, 41 getGeneratedLocation, 42 getOriginalLocation, 43 getOriginalLocations, 44 getOriginalSourceText, 45 getOriginalStackFrames, 46 getGeneratedRangesForOriginal, 47 getFileGeneratedRange, 48 loadSourceMap, 49 setSourceMapForGeneratedSources, 50 clearSourceMapForGeneratedSources, 51 clearSourceMaps, 52 });