diff --git a/devtools/client/debugger/new/README.mozilla b/devtools/client/debugger/new/README.mozilla
index 81fa5d6116bb..faa8e9fd1060 100644
--- a/devtools/client/debugger/new/README.mozilla
+++ b/devtools/client/debugger/new/README.mozilla
@@ -1,7 +1,7 @@
This is the debugger.html project output.
See https://github.com/devtools-html/debugger.html
-Taken from upstream commit: 53faca589b021f01c7af5980c8c0e98b58c02e4c
+Taken from upstream commit: f98e56ff661460044382df55bd33cea601e093f0
Packages:
- babel-plugin-transform-es2015-modules-commonjs @6.26.0
diff --git a/devtools/client/debugger/new/debugger.css b/devtools/client/debugger/new/debugger.css
index d23c286570f7..273e9f1b2e63 100644
--- a/devtools/client/debugger/new/debugger.css
+++ b/devtools/client/debugger/new/debugger.css
@@ -428,24 +428,15 @@ body {
}
.modal {
+ display: flex;
width: 80%;
- height: auto;
+ max-height: 80vh;
overflow-y: auto;
background-color: var(--theme-toolbar-background);
transition: transform 150ms cubic-bezier(0.07, 0.95, 0, 1);
box-shadow: 1px 1px 3px 1px var(--popup-shadow-color);
}
-.modal .input-wrapper {
- display: flex;
- justify-content: center;
-}
-
-.modal .result-list {
- height: calc(100% - 28px);
- overflow-y: auto;
-}
-
.modal.entering,
.modal.exited {
transform: translateY(-101%);
@@ -454,20 +445,17 @@ body {
.modal.entered,
.modal.exiting {
transform: translateY(5px);
+ flex-direction: column;
}
-/* This rule is active when the screen is not short and narrow */
-@media (min-width: 580px) and (min-height: 340px) {
+/* This rule is active when the screen is not narrow */
+@media (min-width: 580px) {
.modal {
width: 50%;
}
}
@media (min-height: 340px) {
- .modal {
- height: auto;
- max-height: 80vh;
- }
.modal.entered,
.modal.exiting {
transform: translateY(30px);
@@ -1757,6 +1745,10 @@ html .toggle-button.end.vertical svg {
justify-content: center;
}
+.source-footer > button.action:hover {
+ background: var(--theme-toolbar-background-hover);
+}
+
.source-footer > .commands > button.action:focus {
outline: none;
}
@@ -2279,12 +2271,17 @@ html[dir="rtl"] .arrow svg,
.popover .preview-popup .header-container {
width: 100%;
- line-height: 20px;
+ line-height: 15px;
display: flex;
- flex-direction: column;
+ flex-direction: row;
margin-bottom: 5px;
}
+.popover .preview-popup .immutable-logo {
+ width: 20px;
+ margin-right: 5px;
+}
+
.popover .preview-popup .header-container h3 {
margin: 0;
margin-bottom: 5px;
@@ -3325,7 +3322,7 @@ img.resume {
border-bottom: none;
background-color: var(--theme-body-background);
border-top: 1px solid var(--theme-splitter-color);
- flex: 0 0 27px;
+ flex: 0 0 26px;
}
.command-bar.bottom {
@@ -3810,6 +3807,7 @@ html .welcomebox .toggle-button-end.collapsed {
padding: 0px;
overflow: auto;
width: calc(100% - 1px); /* 1px fixes the hidden right border */
+ background: var(--theme-body-background);
}
.result-list * {
@@ -3822,7 +3820,6 @@ html .welcomebox .toggle-button-end.collapsed {
padding: 4px 13px;
display: flex;
justify-content: space-between;
- border: 1px solid transparent;
}
.result-list.big li {
@@ -3836,7 +3833,7 @@ html .welcomebox .toggle-button-end.collapsed {
}
.result-list li.selected {
- border-color: var(--theme-selection-background);
+ background: var(--accordion-header-background);
}
.result-list.small li.selected {
diff --git a/devtools/client/debugger/new/debugger.js b/devtools/client/debugger/new/debugger.js
index d2d14cb119a3..497c1230a0b2 100644
--- a/devtools/client/debugger/new/debugger.js
+++ b/devtools/client/debugger/new/debugger.js
@@ -10309,7 +10309,7 @@ if (prefs.debuggerPrefsSchemaVersion !== prefsSchemaVersion) {
/* 247 */
/***/ (function(module, exports) {
-module.exports = ""
+module.exports = ""
/***/ }),
/* 248 */
@@ -10653,14 +10653,14 @@ function isSlowBuffer (obj) {
/* 256 */
/***/ (function(module, exports) {
-module.exports = ""
+module.exports = ""
/***/ }),
/* 257 */,
/* 258 */
/***/ (function(module, exports) {
-module.exports = ""
+module.exports = ""
/***/ }),
/* 259 */
@@ -12298,7 +12298,7 @@ module.exports = ""
/***/ }),
/* 352 */
@@ -12334,7 +12334,7 @@ module.exports = ""
/***/ }),
/* 358 */
@@ -12364,7 +12364,7 @@ module.exports = ""
/***/ }),
/* 363 */
@@ -12418,7 +12418,7 @@ module.exports = ""
/***/ }),
/* 372 */
@@ -12926,7 +12926,7 @@ module.exports = function(module) {
/* 806 */
/***/ (function(module, exports) {
-module.exports = ""
+module.exports = ""
/***/ }),
/* 807 */,
@@ -14067,13 +14067,13 @@ if (!String.prototype.codePointAt) {
/* 919 */
/***/ (function(module, exports) {
-module.exports = ""
+module.exports = ""
/***/ }),
/* 920 */
/***/ (function(module, exports) {
-module.exports = ""
+module.exports = ""
/***/ }),
/* 921 */,
@@ -14532,7 +14532,7 @@ function createStructuredSelector(selectors) {
/* 997 */
/***/ (function(module, exports) {
-module.exports = ""
+module.exports = ""
/***/ }),
/* 998 */
@@ -14544,37 +14544,37 @@ module.exports = ""
/***/ }),
/* 1000 */
/***/ (function(module, exports) {
-module.exports = ""
+module.exports = ""
/***/ }),
/* 1001 */
/***/ (function(module, exports) {
-module.exports = ""
+module.exports = ""
/***/ }),
/* 1002 */
/***/ (function(module, exports) {
-module.exports = ""
+module.exports = ""
/***/ }),
/* 1003 */
/***/ (function(module, exports) {
-module.exports = ""
+module.exports = ""
/***/ }),
/* 1004 */
/***/ (function(module, exports) {
-module.exports = ""
+module.exports = ""
/***/ }),
/* 1005 */,
@@ -14618,19 +14618,19 @@ module.exports = ""
+module.exports = ""
/***/ }),
/* 1044 */
/***/ (function(module, exports) {
-module.exports = ""
+module.exports = ""
/***/ }),
/* 1045 */
/***/ (function(module, exports) {
-module.exports = ""
+module.exports = ""
/***/ }),
/* 1046 */,
@@ -14707,19 +14707,19 @@ module.exports = ""
+module.exports = ""
/***/ }),
/* 1118 */
/***/ (function(module, exports) {
-module.exports = ""
+module.exports = ""
/***/ }),
/* 1119 */
/***/ (function(module, exports) {
-module.exports = ""
+module.exports = ""
/***/ }),
/* 1120 */,
@@ -14794,7 +14794,7 @@ module.exports = ""
/***/ }),
/* 1175 */,
@@ -15966,7 +15966,7 @@ function verifySubselectors(mapStateToProps, mapDispatchToProps, mergeProps, dis
/* 1233 */
/***/ (function(module, exports) {
-module.exports = ""
+module.exports = ""
/***/ }),
/* 1234 */,
@@ -16028,7 +16028,7 @@ module.exports = ""
+module.exports = ""
/***/ }),
/* 1291 */,
@@ -16425,11 +16425,11 @@ var _isSelectedFrameVisible = __webpack_require__(1505);
var _isSelectedFrameVisible2 = _interopRequireDefault(_isSelectedFrameVisible);
-var _getCallStackFrames = __webpack_require__(1771);
+var _getCallStackFrames = __webpack_require__(1780);
var _getCallStackFrames2 = _interopRequireDefault(_getCallStackFrames);
-var _visibleSelectedFrame = __webpack_require__(1772);
+var _visibleSelectedFrame = __webpack_require__(1781);
var _visibleSelectedFrame2 = _interopRequireDefault(_visibleSelectedFrame);
@@ -16941,9 +16941,13 @@ var _toolbox = __webpack_require__(1534);
var toolbox = _interopRequireWildcard(_toolbox);
+var _preview = __webpack_require__(1787);
+
+var preview = _interopRequireWildcard(_preview);
+
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
-exports.default = _extends({}, navigation, breakpoints, expressions, eventListeners, sources, pause, ui, fileSearch, ast, coverage, projectTextSearch, quickOpen, sourceTree, loadSourceText, debuggee, toolbox);
+exports.default = _extends({}, navigation, breakpoints, expressions, eventListeners, sources, pause, ui, fileSearch, ast, coverage, projectTextSearch, quickOpen, sourceTree, loadSourceText, debuggee, toolbox, preview);
/***/ }),
/* 1355 */
@@ -16968,6 +16972,15 @@ Object.defineProperty(exports, "__esModule", {
});
exports.isLoading = exports.isLoaded = exports.getMode = exports.getSourceLineCount = exports.getSourcePath = exports.getFileURL = exports.getFilenameFromURL = exports.getFilename = exports.getRawSourceURL = exports.getPrettySourceURL = exports.shouldPrettyPrint = exports.isThirdParty = exports.isPretty = exports.isJavaScript = exports.isMinified = undefined;
+var _isMinified = __webpack_require__(1779);
+
+Object.defineProperty(exports, "isMinified", {
+ enumerable: true,
+ get: function () {
+ return _isMinified.isMinified;
+ }
+});
+
var _devtoolsSourceMap = __webpack_require__(1360);
var _utils = __webpack_require__(1366);
@@ -16982,15 +16995,6 @@ var _url = __webpack_require__(334);
* @memberof utils/source
* @static
*/
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at . */
-
-/**
- * Utils for working with Source URLs
- * @module utils/source
- */
-
function trimUrlQuery(url) {
const length = url.length;
const q1 = url.indexOf("?");
@@ -17008,8 +17012,8 @@ function shouldPrettyPrint(source) {
const _isPretty = isPretty(source);
const _isJavaScript = isJavaScript(source);
- const isOriginal = (0, _devtoolsSourceMap.isOriginalId)(source.id);
- const hasSourceMap = source.sourceMapURL;
+ const isOriginal = (0, _devtoolsSourceMap.isOriginalId)(source.get("id"));
+ const hasSourceMap = source.get("sourceMapURL");
if (_isPretty || isOriginal || hasSourceMap || !_isJavaScript) {
return false;
@@ -17029,7 +17033,9 @@ function shouldPrettyPrint(source) {
* @static
*/
function isJavaScript(source) {
- return source.url && /\.(jsm|js)?$/.test(trimUrlQuery(source.url)) || !!(source.contentType && source.contentType.includes("javascript"));
+ const url = source.get("url");
+ const contentType = source.get("contentType");
+ return url && /\.(jsm|js)?$/.test(trimUrlQuery(url)) || !!(contentType && contentType.includes("javascript"));
}
/**
@@ -17037,15 +17043,17 @@ function isJavaScript(source) {
* @static
*/
function isPretty(source) {
- return source.url ? /formatted$/.test(source.url) : false;
+ const url = source.get("url");
+ return url ? /formatted$/.test(url) : false;
}
function isThirdParty(source) {
- if (!source || !source.url) {
+ const url = source.get("url");
+ if (!source || !url) {
return false;
}
- return !!source.url.match(/(node_modules|bower_components)/);
+ return !!url.match(/(node_modules|bower_components)/);
}
/**
@@ -17134,12 +17142,12 @@ const contentTypeModeMap = {
"text/html": { name: "htmlmixed" }
};
-function getSourcePath(source) {
- if (!source.url) {
+function getSourcePath(url) {
+ if (!url) {
return "";
}
- const { path, href } = (0, _url.parse)(source.url);
+ const { path, href } = (0, _url.parse)(url);
// for URLs like "about:home" the path is null so we pass the full href
return path || href;
}
@@ -17156,12 +17164,6 @@ function getSourceLineCount(source) {
return source.text != undefined ? source.text.split("\n").length : 0;
}
-// Used to detect minification for automatic pretty printing
-const SAMPLE_SIZE = 50;
-const INDENT_COUNT_THRESHOLD = 5;
-const CHARACTER_LIMIT = 250;
-const _minifiedCache = new Map();
-
/**
*
* Checks if a source is minified based on some heuristics
@@ -17172,46 +17174,6 @@ const _minifiedCache = new Map();
* @static
*/
-function isMinified(key, text) {
- if (!key || !text) {
- return false;
- }
-
- if (_minifiedCache.has(key)) {
- return _minifiedCache.get(key);
- }
-
- let lineEndIndex = 0;
- let lineStartIndex = 0;
- let lines = 0;
- let indentCount = 0;
- let overCharLimit = false;
-
- // Strip comments.
- text = text.replace(/\/\*[\S\s]*?\*\/|\/\/(.+|\n)/g, "");
-
- while (lines++ < SAMPLE_SIZE) {
- lineEndIndex = text.indexOf("\n", lineStartIndex);
- if (lineEndIndex == -1) {
- break;
- }
- if (/^\s+/.test(text.slice(lineStartIndex, lineEndIndex))) {
- indentCount++;
- }
- // For files with no indents but are not minified.
- if (lineEndIndex - lineStartIndex > CHARACTER_LIMIT) {
- overCharLimit = true;
- break;
- }
- lineStartIndex = lineEndIndex + 1;
- }
-
- const minified = indentCount / lines * 100 < INDENT_COUNT_THRESHOLD || overCharLimit;
-
- _minifiedCache.set(key, minified);
- return minified;
-}
-
/**
*
* Returns Code Mirror mode for source content type
@@ -17280,13 +17242,12 @@ function getMode(source, sourceMetaData) {
}
function isLoaded(source) {
- return source.loadedState === "loaded";
+ return source.get("loadedState") === "loaded";
}
function isLoading(source) {
- return source.loadedState === "loading";
+ return source.get("loadedState") === "loading";
}
-exports.isMinified = isMinified;
exports.isJavaScript = isJavaScript;
exports.isPretty = isPretty;
exports.isThirdParty = isThirdParty;
@@ -17340,9 +17301,7 @@ var sourceDocumentUtils = _interopRequireWildcard(_sourceDocuments);
var _source = __webpack_require__(1356);
-var _expression = __webpack_require__(1525);
-
-var expressionUtils = _interopRequireWildcard(_expression);
+var _getTokenLocation = __webpack_require__(1784);
var _sourceSearch = __webpack_require__(1526);
@@ -17365,7 +17324,6 @@ function shouldShowPrettyPrint(selectedSource) {
return false;
}
- selectedSource = selectedSource.toJS();
return (0, _source.shouldPrettyPrint)(selectedSource);
}
@@ -17483,7 +17441,7 @@ function getSourceLocationFromMouseEvent(editor, selectedLocation, e) {
};
}
-module.exports = _extends({}, expressionUtils, sourceDocumentUtils, sourceSearchUtils, _devtoolsSourceEditor.SourceEditorUtils, {
+module.exports = _extends({}, sourceDocumentUtils, sourceSearchUtils, _devtoolsSourceEditor.SourceEditorUtils, {
createEditor,
isWasm: _wasm.isWasm,
toEditorLine,
@@ -17498,7 +17456,8 @@ module.exports = _extends({}, expressionUtils, sourceDocumentUtils, sourceSearch
markText,
lineAtHeight,
getSourceLocationFromMouseEvent,
- resizeBreakpointGutter: _ui.resizeBreakpointGutter
+ resizeBreakpointGutter: _ui.resizeBreakpointGutter,
+ getTokenLocation: _getTokenLocation.getTokenLocation
});
/***/ }),
@@ -18032,7 +17991,7 @@ function createPendingBreakpoint(bp) {
Object.defineProperty(exports, "__esModule", {
value: true
});
-exports.replaceOriginalVariableName = exports.isReactComponent = exports.hasSyntaxError = exports.clearSources = exports.setSource = exports.hasSource = exports.getEmptyLines = exports.getNextStep = exports.clearASTs = exports.clearScopes = exports.clearSymbols = exports.getOutOfScopeLocations = exports.getVariablesInScope = exports.getScopes = exports.getSymbols = exports.getClosestExpression = exports.stopParserWorker = exports.startParserWorker = undefined;
+exports.replaceOriginalVariableName = exports.isReactComponent = exports.hasSyntaxError = exports.clearSources = exports.setSource = exports.hasSource = exports.getEmptyLines = exports.getNextStep = exports.clearASTs = exports.clearScopes = exports.clearSymbols = exports.findOutOfScopeLocations = exports.getVariablesInScope = exports.getScopes = exports.getSymbols = exports.getClosestExpression = exports.stopParserWorker = exports.startParserWorker = undefined;
var _devtoolsUtils = __webpack_require__(1363);
@@ -18048,7 +18007,7 @@ const getClosestExpression = exports.getClosestExpression = dispatcher.task("get
const getSymbols = exports.getSymbols = dispatcher.task("getSymbols");
const getScopes = exports.getScopes = dispatcher.task("getScopes");
const getVariablesInScope = exports.getVariablesInScope = dispatcher.task("getVariablesInScope");
-const getOutOfScopeLocations = exports.getOutOfScopeLocations = dispatcher.task("getOutOfScopeLocations");
+const findOutOfScopeLocations = exports.findOutOfScopeLocations = dispatcher.task("findOutOfScopeLocations");
const clearSymbols = exports.clearSymbols = dispatcher.task("clearSymbols");
const clearScopes = exports.clearScopes = dispatcher.task("clearScopes");
const clearASTs = exports.clearASTs = dispatcher.task("clearASTs");
@@ -18374,17 +18333,12 @@ function update(state = initialState(), action) {
switch (action.type) {
case "ADD_SOURCE":
{
- const source = action.source;
- return updateSource(state, source);
+ return updateSource(state, action.source);
}
case "ADD_SOURCES":
{
- action.sources.forEach(source => {
- state = state.mergeIn(["sources", source.id], source);
- });
-
- return state;
+ return action.sources.reduce((newState, source) => updateSource(newState, source), state);
}
case "SELECT_SOURCE":
@@ -18443,9 +18397,6 @@ function update(state = initialState(), action) {
}
break;
- case "TOGGLE_PRETTY_PRINT":
- return setSourceTextProps(state, action);
-
case "NAVIGATE":
const source = getSelectedSource({ sources: state });
const url = source && source.get("url");
@@ -18461,17 +18412,16 @@ function update(state = initialState(), action) {
}
function getTextPropsFromAction(action) {
- const source = action.source;
- const { value } = action;
+ const { value, sourceId } = action;
if (action.status === "start") {
- return { id: source.id, loadedState: "loading" };
+ return { id: sourceId, loadedState: "loading" };
} else if (action.status === "error") {
- return { id: source.id, error: action.error, loadedState: "loaded" };
+ return { id: sourceId, error: action.error, loadedState: "loaded" };
}
return {
text: value.text,
- id: source.id,
+ id: sourceId,
contentType: value.contentType,
loadedState: "loaded"
};
@@ -18717,7 +18667,7 @@ function isDirectory(url) {
}
function isNotJavaScript(source) {
- const parsedUrl = (0, _url.parse)(source.url).pathname;
+ const parsedUrl = (0, _url.parse)(source.get("url")).pathname;
if (!parsedUrl) {
return false;
}
@@ -18727,7 +18677,7 @@ function isNotJavaScript(source) {
}
function isInvalidUrl(url, source) {
- return IGNORED_URLS.indexOf(url) != -1 || !source.get("url") || source.get("loadedState") === "loading" || !url.group || (0, _source.isPretty)(source.toJS()) || isNotJavaScript(source.toJS());
+ return IGNORED_URLS.indexOf(url) != -1 || !source.get("url") || source.get("loadedState") === "loading" || !url.group || (0, _source.isPretty)(source) || isNotJavaScript(source);
}
function partIsFile(index, parts, url) {
@@ -18960,7 +18910,7 @@ var _ui = __webpack_require__(1385);
var _source2 = __webpack_require__(1356);
-var _location = __webpack_require__(1774);
+var _location = __webpack_require__(1783);
var _createPrettySource = __webpack_require__(1523);
@@ -18972,34 +18922,43 @@ var _editor = __webpack_require__(1358);
var _sourceMaps = __webpack_require__(1397);
+var _devtoolsSourceMap = __webpack_require__(1360);
+
var _selectors = __webpack_require__(1352);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
// If a request has been made to show this source, go ahead and
// select it.
-async function checkSelectedSource(state, dispatch, source) {
- const pendingLocation = (0, _selectors.getPendingSelectedLocation)(state);
+function checkSelectedSource(source) {
+ return async ({ dispatch, getState }) => {
+ const pendingLocation = (0, _selectors.getPendingSelectedLocation)(getState());
- if (pendingLocation && !!source.url && pendingLocation.url === source.url) {
- await dispatch(selectLocation(_extends({}, pendingLocation, { sourceId: source.id })));
- }
+ if (pendingLocation && !!source.url && pendingLocation.url === source.url) {
+ await dispatch(selectLocation(_extends({}, pendingLocation, { sourceId: source.id })));
+ }
+ };
}
-async function checkPendingBreakpoints(state, dispatch, sourceId) {
- // source may have been modified by selectLocation
- const source = (0, _selectors.getSource)(state, sourceId).toJS();
- const pendingBreakpoints = (0, _selectors.getPendingBreakpointsForSource)(state, source.url);
- if (!pendingBreakpoints.size) {
- return;
- }
+function checkPendingBreakpoints(sourceId) {
+ return async ({ dispatch, getState }) => {
+ // source may have been modified by selectLocation
+ const source = (0, _selectors.getSource)(getState(), sourceId);
- // load the source text if there is a pending breakpoint for it
- await dispatch((0, _loadSourceText.loadSourceText)(source));
- const pendingBreakpointsArray = pendingBreakpoints.valueSeq().toJS();
- for (const pendingBreakpoint of pendingBreakpointsArray) {
- await dispatch((0, _breakpoints.syncBreakpoint)(sourceId, pendingBreakpoint));
- }
+ const pendingBreakpoints = (0, _selectors.getPendingBreakpointsForSource)(getState(), source.get("url"));
+
+ if (!pendingBreakpoints.size) {
+ return;
+ }
+
+ // load the source text if there is a pending breakpoint for it
+ await dispatch((0, _loadSourceText.loadSourceText)(source));
+
+ const pendingBreakpointsArray = pendingBreakpoints.valueSeq().toJS();
+ for (const pendingBreakpoint of pendingBreakpointsArray) {
+ await dispatch((0, _breakpoints.syncBreakpoint)(sourceId, pendingBreakpoint));
+ }
+ };
}
/**
@@ -19017,11 +18976,11 @@ function newSource(source) {
dispatch({ type: "ADD_SOURCE", source });
if (_prefs.prefs.clientSourceMapsEnabled) {
- await dispatch(loadSourceMap(source));
+ dispatch(loadSourceMap(source));
}
- await checkSelectedSource(getState(), dispatch, source);
- await checkPendingBreakpoints(getState(), dispatch, source.id);
+ dispatch(checkSelectedSource(source));
+ dispatch(checkPendingBreakpoints(source.id));
};
}
@@ -19029,9 +18988,32 @@ function newSources(sources) {
return async ({ dispatch, getState }) => {
const filteredSources = sources.filter(source => !(0, _selectors.getSource)(getState(), source.id));
- for (const source of filteredSources) {
- await dispatch(newSource(source));
+ if (filteredSources.length == 0) {
+ return;
}
+
+ dispatch({
+ type: "ADD_SOURCES",
+ sources: filteredSources
+ });
+
+ for (const source of filteredSources) {
+ dispatch(checkSelectedSource(source));
+ dispatch(checkPendingBreakpoints(source.id));
+ }
+
+ return Promise.all(filteredSources.map(source => dispatch(loadSourceMap(source))));
+ };
+}
+
+function createOriginalSource(originalUrl, generatedSource, sourceMaps) {
+ return {
+ url: originalUrl,
+ id: sourceMaps.generatedToOriginalId(generatedSource.id, originalUrl),
+ isPrettyPrinted: false,
+ isWasm: false,
+ isBlackBoxed: false,
+ loadedState: "unloaded"
};
}
@@ -19042,27 +19024,19 @@ function newSources(sources) {
function loadSourceMap(generatedSource) {
return async function ({ dispatch, getState, sourceMaps }) {
const urls = await sourceMaps.getOriginalURLs(generatedSource);
+
if (!urls) {
// If this source doesn't have a sourcemap, do nothing.
return;
}
- const originalSources = urls.map(originalUrl => ({
- url: originalUrl,
- id: sourceMaps.generatedToOriginalId(generatedSource.id, originalUrl),
- isPrettyPrinted: false,
- isWasm: false,
- isBlackBoxed: false,
- loadedState: "unloaded"
- }));
+ const originalSources = urls.map(url => createOriginalSource(url, generatedSource, sourceMaps));
- dispatch({ type: "ADD_SOURCES", sources: originalSources });
-
- await dispatch((0, _loadSourceText.loadSourceText)(generatedSource));
- originalSources.forEach(async source => {
- await checkSelectedSource(getState(), dispatch, source);
- checkPendingBreakpoints(getState(), dispatch, source.id);
- });
+ // TODO: check if this line is really needed, it introduces
+ // a lot of lag to the application.
+ const generatedSourceRecord = (0, _selectors.getSource)(getState(), generatedSource.id);
+ await dispatch((0, _loadSourceText.loadSourceText)(generatedSourceRecord));
+ dispatch(newSources(originalSources));
};
}
@@ -19103,9 +19077,9 @@ function selectSourceURL(url, options = {}) {
* @static
*/
function selectSource(sourceId, tabIndex = "") {
- return ({ dispatch }) => {
+ return async ({ dispatch }) => {
const location = (0, _location.createLocation)({ sourceId });
- return dispatch(selectLocation(location, tabIndex));
+ return await dispatch(selectLocation(location, tabIndex));
};
}
@@ -19140,12 +19114,12 @@ function selectLocation(location, tabIndex = "") {
tabIndex,
location,
[_promise.PROMISE]: (async () => {
- await dispatch((0, _loadSourceText.loadSourceText)(source.toJS()));
- await dispatch((0, _ast.setOutOfScopeLocations)());
- const src = (0, _selectors.getSource)(getState(), location.sourceId).toJS();
+ await dispatch((0, _loadSourceText.loadSourceText)(source));
+ dispatch((0, _ast.setOutOfScopeLocations)());
+ const src = (0, _selectors.getSource)(getState(), location.sourceId);
const { autoPrettyPrint } = _prefs.prefs;
- if (autoPrettyPrint && (0, _source2.shouldPrettyPrint)(src) && (0, _source2.isMinified)(src.id, src.text)) {
- await dispatch(togglePrettyPrint(src.id));
+ if (autoPrettyPrint && (0, _source2.shouldPrettyPrint)(src) && (0, _source2.isMinified)(src)) {
+ await dispatch(togglePrettyPrint(src.get("id")));
}
})()
});
@@ -19164,7 +19138,7 @@ function jumpToMappedLocation(sourceLocation) {
const source = (0, _selectors.getSource)(getState(), sourceLocation.sourceId);
let pairedLocation;
- if (sourceMaps.isOriginalId(sourceLocation.sourceId)) {
+ if ((0, _devtoolsSourceMap.isOriginalId)(sourceLocation.sourceId)) {
pairedLocation = await (0, _sourceMaps.getGeneratedLocation)(getState(), source.toJS(), sourceLocation, sourceMaps);
} else {
pairedLocation = await sourceMaps.getOriginalLocation(sourceLocation, source.toJS());
@@ -19240,16 +19214,20 @@ function closeTabs(urls) {
*/
function togglePrettyPrint(sourceId) {
return async ({ dispatch, getState, client, sourceMaps }) => {
- const source = (0, _selectors.getSource)(getState(), sourceId).toJS();
+ const source = (0, _selectors.getSource)(getState(), sourceId);
- if (!source || !(0, _source2.isLoaded)(source)) {
+ if (!source) {
return {};
}
+ if (!(0, _source2.isLoaded)(source)) {
+ await dispatch((0, _loadSourceText.loadSourceText)(source));
+ }
+
(0, _assert2.default)(sourceMaps.isGeneratedId(sourceId), "Pretty-printing only allowed on generated sources");
const selectedLocation = (0, _selectors.getSelectedLocation)(getState());
- const url = (0, _source2.getPrettySourceURL)(source.url);
+ const url = (0, _source2.getPrettySourceURL)(source.get("url"));
const prettySource = (0, _selectors.getSourceByURL)(getState(), url);
const options = {};
@@ -19292,8 +19270,7 @@ function loadAllSources() {
return async ({ dispatch, getState }) => {
const sources = (0, _selectors.getSources)(getState());
const query = (0, _selectors.getTextSearchQuery)(getState());
- for (const [, src] of sources) {
- const source = src.toJS();
+ for (const [, source] of sources) {
if ((0, _source2.isThirdParty)(source)) {
continue;
}
@@ -19302,7 +19279,7 @@ function loadAllSources() {
// If there is a current search query we search
// each of the source texts as they get loaded
if (query) {
- await dispatch((0, _projectTextSearch.searchSource)(source.id, query));
+ await dispatch((0, _projectTextSearch.searchSource)(source.get("id"), query));
}
}
};
@@ -20357,6 +20334,7 @@ function update(state = initialState(), action) {
cursorPos,
extra
} = action.value;
+
return state.set("preview", {
updating: false,
expression,
@@ -20392,14 +20370,16 @@ function update(state = initialState(), action) {
// NOTE: we'd like to have the app state fully typed
// https://github.com/devtools-html/debugger.html/blob/master/src/reducers/sources.js#L179-L185
+
+
+const emptySymbols = { variables: [], functions: [] };
function getSymbols(state, source) {
- const emptySet = { variables: [], functions: [] };
if (!source) {
- return emptySet;
+ return emptySymbols;
}
const symbols = state.ast.getIn(["symbols", source.id]);
- return symbols || emptySet;
+ return symbols || emptySymbols;
}
function hasSymbols(state, source) {
@@ -21115,19 +21095,6 @@ function update(state = State(), action) {
const frameScopes = _extends({}, state.frameScopes, { [selectedFrameId]: scopes });
return _extends({}, state, { frameScopes });
- case "TOGGLE_PRETTY_PRINT":
- if (action.status == "done") {
- const frames = action.value.frames;
- const pause = state.pause;
- if (pause) {
- pause.frame = frames[0];
- }
-
- return _extends({}, state, { pause, frames });
- }
-
- break;
-
case "BREAK_ON_NEXT":
return _extends({}, state, { isWaitingOnBreak: true });
@@ -21909,36 +21876,17 @@ async function getMappedExpression({ sourceMaps }, generatedLocation, expression
Object.defineProperty(exports, "__esModule", {
value: true
});
-
-var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; /* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at . */
-
exports.setSourceMetaData = setSourceMetaData;
exports.setSymbols = setSymbols;
exports.setEmptyLines = setEmptyLines;
exports.setOutOfScopeLocations = setOutOfScopeLocations;
-exports.clearPreview = clearPreview;
-exports.setPreview = setPreview;
var _selectors = __webpack_require__(1352);
-var _expressions = __webpack_require__(1398);
-
-var _setInScopeLines = __webpack_require__(1773);
-
-var _promise = __webpack_require__(1653);
+var _setInScopeLines = __webpack_require__(1782);
var _parser = __webpack_require__(1365);
-var _ast = __webpack_require__(1638);
-
-var _devtoolsSourceMap = __webpack_require__(1360);
-
-const extraProps = {
- react: { displayName: "this._reactInternalInstance.getName()" }
-};
-
function setSourceMetaData(sourceId) {
return async ({ dispatch, getState }) => {
const sourceRecord = (0, _selectors.getSource)(getState(), sourceId);
@@ -21960,7 +21908,9 @@ function setSourceMetaData(sourceId) {
}
});
};
-}
+} /* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at . */
function setSymbols(sourceId) {
return async ({ dispatch, getState }) => {
@@ -21970,18 +21920,13 @@ function setSymbols(sourceId) {
}
const source = sourceRecord.toJS();
+
if (!source.text || source.isWasm || (0, _selectors.hasSymbols)(getState(), source)) {
return;
}
const symbols = await (0, _parser.getSymbols)(source);
-
- dispatch({
- type: "SET_SYMBOLS",
- source,
- symbols
- });
-
+ dispatch({ type: "SET_SYMBOLS", source, symbols });
dispatch(setEmptyLines(source.id));
dispatch(setSourceMetaData(source.id));
};
@@ -22019,7 +21964,7 @@ function setOutOfScopeLocations() {
const source = (0, _selectors.getSource)(getState(), location.sourceId);
- const locations = !location.line || !source ? null : await (0, _parser.getOutOfScopeLocations)(source.toJS(), location);
+ const locations = !location.line || !source ? null : await (0, _parser.findOutOfScopeLocations)(source.toJS(), location);
dispatch({
type: "OUT_OF_SCOPE_LOCATIONS",
@@ -22030,76 +21975,6 @@ function setOutOfScopeLocations() {
};
}
-function clearPreview() {
- return ({ dispatch, getState, client }) => {
- const currentSelection = (0, _selectors.getPreview)(getState());
- if (!currentSelection) {
- return;
- }
-
- return dispatch({
- type: "CLEAR_SELECTION"
- });
- };
-}
-
-function setPreview(token, tokenPos, cursorPos) {
- return async ({ dispatch, getState, client, sourceMaps }) => {
- const currentSelection = (0, _selectors.getPreview)(getState());
- if (currentSelection && currentSelection.updating) {
- return;
- }
-
- await dispatch({
- type: "SET_PREVIEW",
- [_promise.PROMISE]: async function () {
- const source = (0, _selectors.getSelectedSource)(getState());
- const _symbols = await (0, _parser.getSymbols)(source.toJS());
-
- const found = (0, _ast.findBestMatchExpression)(_symbols, tokenPos, token);
- if (!found) {
- return;
- }
-
- let { expression, location } = found;
-
- if (!expression) {
- return;
- }
-
- const sourceId = source.get("id");
- if (location && !(0, _devtoolsSourceMap.isGeneratedId)(sourceId)) {
- const generatedLocation = await sourceMaps.getGeneratedLocation(_extends({}, location.start, { sourceId }), source.toJS());
-
- expression = await (0, _expressions.getMappedExpression)({ sourceMaps }, generatedLocation, expression);
- }
-
- const selectedFrame = (0, _selectors.getSelectedFrame)(getState());
- const { result } = await client.evaluate(expression, {
- frameId: selectedFrame.id
- });
-
- const data = await client.evaluate(extraProps.react.displayName, {
- frameId: selectedFrame.id
- });
-
- if (result === undefined) {
- return;
- }
-
- return {
- expression,
- result,
- location,
- tokenPos,
- cursorPos,
- extra: data && data.result
- };
- }()
- });
- };
-}
-
/***/ }),
/* 1400 */
/***/ (function(module, exports, __webpack_require__) {
@@ -22111,24 +21986,18 @@ Object.defineProperty(exports, "__esModule", {
value: true
});
-var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; /* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at . */
-
-// eslint-disable-next-line max-len
-
+var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
exports.updateFrameLocations = updateFrameLocations;
-exports.updateScopeBindings = updateScopeBindings;
exports.getPauseReason = getPauseReason;
exports.getPausedPosition = getPausedPosition;
exports.inDebuggerEval = inDebuggerEval;
var _lodash = __webpack_require__(2);
-var _parser = __webpack_require__(1365);
-
-var _updateScopeBindings = __webpack_require__(1775);
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at . */
function updateFrameLocations(frames, sourceMaps) {
if (!frames || frames.length == 0) {
@@ -22141,19 +22010,6 @@ function updateFrameLocations(frames, sourceMaps) {
}))));
}
-async function updateScopeBindings(scope, generatedLocation, originalLocation, { getLocationScopes, loadSourceText }) {
- return (0, _updateScopeBindings.updateScopeBindings)(scope, generatedLocation, originalLocation, {
- async getSourceMapsScopes(location) {
- const astScopes = await (0, _parser.getScopes)(location);
- return getLocationScopes(location, astScopes);
- },
- async getOriginalSourceScopes(location) {
- await loadSourceText(location.sourceId);
- return (0, _parser.getScopes)(location);
- }
- });
-}
-
// Map protocol pause "why" reason to a valid L10N key
// These are the known unhandled reasons:
// "breakpointConditionThrown", "clientEvaluated"
@@ -22848,7 +22704,7 @@ var _Svg = __webpack_require__(1359);
var _Svg2 = _interopRequireDefault(_Svg);
-var _CommandBarButton = __webpack_require__(1787);
+var _CommandBarButton = __webpack_require__(1765);
var _CommandBarButton2 = _interopRequireDefault(_CommandBarButton);
@@ -23249,7 +23105,7 @@ module.exports = Grip;
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
const React = __webpack_require__(0);
-const InlineSVG = __webpack_require__(1793);
+const InlineSVG = __webpack_require__(1790);
const svg = {
"arrow": __webpack_require__(1152),
@@ -23317,7 +23173,7 @@ module.exports = function defer() {
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-const { Menu, MenuItem } = __webpack_require__(1762);
+const { Menu, MenuItem } = __webpack_require__(1768);
function inToolbox() {
return window.parent.document.documentURI == "about:devtools-toolbox";
@@ -24813,7 +24669,7 @@ async function prettyPrint({ source, url }) {
return await _prettyPrint({
url,
indent,
- source: source.text
+ sourceText: source.get("text")
});
}
@@ -24917,9 +24773,9 @@ function searchSources(query) {
dispatch(updateSearchStatus(_projectTextSearch.statusType.fetching));
await dispatch((0, _sources.loadAllSources)());
const sources = (0, _selectors.getSources)(getState());
- const validSources = sources.valueSeq().filter(source => (0, _source.isLoaded)(source.toJS()) && !(0, _source.isThirdParty)(source.toJS())).toJS();
+ const validSources = sources.valueSeq().filter(source => (0, _source.isLoaded)(source) && !(0, _source.isThirdParty)(source));
for (const source of validSources) {
- await dispatch(searchSource(source.id, query));
+ await dispatch(searchSource(source.get("id"), query));
}
};
}
@@ -24931,13 +24787,12 @@ function searchSource(sourceId, query) {
return;
}
- const source = sourceRecord.toJS();
- const matches = await (0, _search.findSourceMatches)(source, query);
+ const matches = await (0, _search.findSourceMatches)(sourceRecord.toJS(), query);
dispatch({
type: "ADD_SEARCH_RESULT",
result: {
- sourceId: source.id,
- filepath: source.url,
+ sourceId: sourceRecord.get("id"),
+ filepath: sourceRecord.get("url"),
matches
}
});
@@ -24960,6 +24815,8 @@ Object.defineProperty(exports, "__esModule", {
});
exports.loadSourceText = loadSourceText;
+var _devtoolsSourceMap = __webpack_require__(1360);
+
var _promise = __webpack_require__(1653);
var _ast = __webpack_require__(1399);
@@ -24970,19 +24827,22 @@ var _parser = __webpack_require__(1365);
var _source = __webpack_require__(1356);
-const requests = new Map(); /* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at . */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at . */
+
+const requests = new Map();
async function loadSource(source, { sourceMaps, client }) {
- if (sourceMaps.isOriginalId(source.id)) {
- return await sourceMaps.getOriginalSourceText(source);
+ const id = source.get("id");
+ if ((0, _devtoolsSourceMap.isOriginalId)(id)) {
+ return await sourceMaps.getOriginalSourceText(source.toJS());
}
- const response = await client.sourceContents(source.id);
+ const response = await client.sourceContents(id);
return {
- id: source.id,
+ id,
text: response.source,
contentType: response.contentType || "text/javascript"
};
@@ -25012,28 +24872,35 @@ function loadSourceText(source) {
return Promise.resolve(source);
}
- if ((0, _source.isLoading)(source) || requests.has(source.id)) {
- return requests.get(source.id);
+ const id = source.get("id");
+
+ if ((0, _source.isLoading)(source) || requests.has(id)) {
+ return requests.get(id);
}
- requests.set(source.id, deferred.promise);
+ requests.set(id, deferred.promise);
await dispatch({
type: "LOAD_SOURCE_TEXT",
- source: source,
+ sourceId: id,
[_promise.PROMISE]: loadSource(source, { sourceMaps, client })
});
- const newSource = (0, _selectors.getSource)(getState(), source.id).toJS();
+ const newSource = (0, _selectors.getSource)(getState(), source.get("id")).toJS();
if (newSource.isWasm) {
return;
}
+ if ((0, _devtoolsSourceMap.isOriginalId)(newSource.id)) {
+ const generatedSource = (0, _selectors.getGeneratedSource)(getState(), source.toJS());
+ await dispatch(loadSourceText(generatedSource));
+ }
+
await (0, _parser.setSource)(newSource);
- dispatch((0, _ast.setSymbols)(source.id));
+ dispatch((0, _ast.setSymbols)(id));
// signal that the action is finished
deferred.resolve();
- requests.delete(source.id);
+ requests.delete(id);
};
}
@@ -27003,7 +26870,7 @@ class FrameComponent extends _react.Component {
}
onMouseDown(e, frame, selectedFrame) {
- if (e.nativeEvent.which == 3 && selectedFrame.id != frame.id) {
+ if (e.nativeEvent.which == 3 || selectedFrame.id === frame.id) {
return;
}
this.props.selectFrame(frame);
@@ -27158,15 +27025,17 @@ var _client = __webpack_require__(1499);
var _bootstrap = __webpack_require__(1430);
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+var _sourceQueue = __webpack_require__(1762);
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at . */
+var _sourceQueue2 = _interopRequireDefault(_sourceQueue);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
if (false) {
window.Perf = require("react-addons-perf");
-}
+} /* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at . */
if ((0, _devtoolsConfig.isFirefoxPanel)()) {
module.exports = {
@@ -27191,6 +27060,7 @@ if ((0, _devtoolsConfig.isFirefoxPanel)()) {
},
destroy: () => {
(0, _devtoolsLaunchpad.unmountRoot)(_reactDom2.default);
+ _sourceQueue2.default.clear();
(0, _bootstrap.teardownWorkers)();
}
};
@@ -29431,7 +29301,7 @@ module.exports = connect(mapStateToProps, mapDispatchToProps)(LaunchpadApp);
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-const { score } = __webpack_require__(1788);
+const { score } = __webpack_require__(1775);
function getTabs(state) {
let tabs = state.tabs.get("tabs");
@@ -29482,7 +29352,7 @@ const React = __webpack_require__(0);
__webpack_require__(1298);
const { Component } = React;
const PropTypes = __webpack_require__(20);
-const dom = __webpack_require__(1759);
+const dom = __webpack_require__(1758);
const ImPropTypes = __webpack_require__(150);
const configMap = __webpack_require__(1377).sidePanelItems;
const Tabs = React.createFactory(__webpack_require__(1492));
@@ -29694,7 +29564,7 @@ const React = __webpack_require__(0);
__webpack_require__(1299);
const { Component } = React;
-const dom = __webpack_require__(1759);
+const dom = __webpack_require__(1758);
const PropTypes = __webpack_require__(20);
const classnames = __webpack_require__(175);
@@ -29766,7 +29636,7 @@ module.exports = Tabs;
const React = __webpack_require__(0);
__webpack_require__(1300);
const { Component } = React;
-const dom = __webpack_require__(1759);
+const dom = __webpack_require__(1758);
const PropTypes = __webpack_require__(20);
const classnames = __webpack_require__(175);
const Svg = __webpack_require__(1494);
@@ -29836,7 +29706,7 @@ module.exports = Sidebar;
const React = __webpack_require__(0);
-const { default: InlineSVG } = __webpack_require__(1786);
+const { default: InlineSVG } = __webpack_require__(1764);
const { isDevelopment } = __webpack_require__(1355);
const svg = {
@@ -29874,7 +29744,7 @@ module.exports = Svg;
const React = __webpack_require__(0);
const { Component } = React;
-const dom = __webpack_require__(1759);
+const dom = __webpack_require__(1758);
const PropTypes = __webpack_require__(20);
const { showMenu, buildMenu } = __webpack_require__(1413);
@@ -30822,11 +30692,19 @@ exports.clientEvents = exports.setupEvents = undefined;
var _create = __webpack_require__(1428);
+var _sourceQueue = __webpack_require__(1762);
+
+var _sourceQueue2 = _interopRequireDefault(_sourceQueue);
+
var _devtoolsConfig = __webpack_require__(1355);
-const CALL_STACK_PAGE_SIZE = 1000; /* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at . */
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at . */
+
+const CALL_STACK_PAGE_SIZE = 1000;
let threadClient;
let actions;
@@ -30836,6 +30714,7 @@ function setupEvents(dependencies) {
threadClient = dependencies.threadClient;
actions = dependencies.actions;
supportsWasm = dependencies.supportsWasm;
+ _sourceQueue2.default.initialize({ actions, supportsWasm, createSource: _create.createSource });
if (threadClient) {
Object.keys(clientEvents).forEach(eventName => {
@@ -30858,6 +30737,7 @@ async function paused(_, packet) {
if (why.type != "alreadyPaused") {
const pause = (0, _create.createPause)(packet, response);
+ _sourceQueue2.default.flush();
actions.paused(pause);
}
}
@@ -30867,7 +30747,7 @@ function resumed(_, packet) {
}
function newSource(_, { source }) {
- actions.newSource((0, _create.createSource)(source, { supportsWasm }));
+ _sourceQueue2.default.queue(source);
if ((0, _devtoolsConfig.isEnabled)("eventListeners")) {
actions.fetchEventListeners();
@@ -31890,8 +31770,8 @@ var _source = __webpack_require__(1356);
function createPrettySource(sourceId) {
return async ({ dispatch, getState, sourceMaps }) => {
- const source = (0, _selectors.getSource)(getState(), sourceId).toJS();
- const url = (0, _source.getPrettySourceURL)(source.url);
+ const source = (0, _selectors.getSource)(getState(), sourceId);
+ const url = (0, _source.getPrettySourceURL)(source.get("url"));
const id = await sourceMaps.generatedToOriginalId(sourceId, url);
const { code, mappings } = await (0, _prettyPrint.prettyPrint)({
@@ -31899,7 +31779,7 @@ function createPrettySource(sourceId) {
url
});
- await sourceMaps.applySourceMap(source.id, url, code, mappings);
+ await sourceMaps.applySourceMap(source.get("id"), url, code, mappings);
let frames = (0, _selectors.getFrames)(getState());
if (frames) {
@@ -31980,70 +31860,7 @@ module.exports = {
};
/***/ }),
-/* 1525 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-exports.getTokenLocation = getTokenLocation;
-exports.updatePreview = updatePreview;
-
-var _lodash = __webpack_require__(2);
-
-function getTokenLocation(codeMirror, tokenEl) {
- const { left, top, width, height } = tokenEl.getBoundingClientRect();
- const { line, ch } = codeMirror.coordsChar({
- left: left + width / 2,
- top: top + height / 2
- });
-
- return {
- line: line + 1,
- column: ch
- };
-} /* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at . */
-
-function updatePreview(target, editor, { linesInScope, preview, setPreview, clearPreview }) {
- const location = getTokenLocation(editor.codeMirror, target);
- const tokenText = target.innerText ? target.innerText.trim() : "";
- const cursorPos = target.getBoundingClientRect();
-
- if (preview) {
- // We are mousing over the same token as before
- if ((0, _lodash.isEqual)(preview.tokenPos, location)) {
- return;
- }
-
- // We are mousing over a new token that is not in the preview
- if (!target.classList.contains("debug-expression")) {
- clearPreview();
- }
- }
-
- const invalidToken = tokenText === "" || tokenText.match(/[(){}\|&%,.;=<>\+-/\*\s]/);
-
- const invalidTarget = target.parentElement && !target.parentElement.closest(".CodeMirror-line") || cursorPos.top == 0;
-
- const isUpdating = preview && preview.updating;
-
- const inScope = linesInScope && linesInScope.includes(location.line);
-
- const invaildType = target.className === "cm-string" || target.className === "cm-number" || target.className === "cm-atom";
-
- if (invalidTarget || !inScope || isUpdating || invalidToken || invaildType) {
- return;
- }
-
- setPreview(tokenText, location, cursorPos);
-}
-
-/***/ }),
+/* 1525 */,
/* 1526 */
/***/ (function(module, exports, __webpack_require__) {
@@ -32524,6 +32341,10 @@ exports.navigated = navigated;
var _editor = __webpack_require__(1358);
+var _sourceQueue = __webpack_require__(1762);
+
+var _sourceQueue2 = _interopRequireDefault(_sourceQueue);
+
var _sources = __webpack_require__(1369);
var _utils = __webpack_require__(1366);
@@ -32534,6 +32355,8 @@ var _parser = __webpack_require__(1365);
var _wasm = __webpack_require__(1401);
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
/**
* Redux actions for the navigation state
* @module actions/navigation
@@ -32543,10 +32366,6 @@ var _wasm = __webpack_require__(1401);
* @memberof actions/navigation
* @static
*/
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at . */
-
function willNavigate(_, event) {
return async function ({ dispatch, getState, client, sourceMaps }) {
await sourceMaps.clearSourceMaps();
@@ -32556,10 +32375,13 @@ function willNavigate(_, event) {
(0, _parser.clearASTs)();
(0, _parser.clearScopes)();
(0, _parser.clearSources)();
+ _sourceQueue2.default.clear();
dispatch(navigate(event.url));
};
-}
+} /* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at . */
function navigate(url) {
return {
@@ -32977,7 +32799,7 @@ const ReactDOM = __webpack_require__(4);
const Draggable = React.createFactory(__webpack_require__(1537));
const { Component } = React;
const PropTypes = __webpack_require__(20);
-const dom = __webpack_require__(1759);
+const dom = __webpack_require__(1758);
__webpack_require__(1309);
@@ -33225,7 +33047,7 @@ const React = __webpack_require__(0);
const ReactDOM = __webpack_require__(4);
const { Component } = React;
const PropTypes = __webpack_require__(20);
-const dom = __webpack_require__(1759);
+const dom = __webpack_require__(1758);
class Draggable extends Component {
static get propTypes() {
@@ -33388,19 +33210,6 @@ class ProjectSearch extends _react.Component {
);
}
}
-
-ProjectSearch.propTypes = {
- sources: _propTypes2.default.object.isRequired,
- results: _propTypes2.default.object,
- textSearchQuery: _propTypes2.default.string,
- setActiveSearch: _propTypes2.default.func.isRequired,
- closeActiveSearch: _propTypes2.default.func.isRequired,
- closeProjectSearch: _propTypes2.default.func.isRequired,
- searchSources: _propTypes2.default.func,
- activeSearch: _propTypes2.default.string,
- selectLocation: _propTypes2.default.func.isRequired
-};
-
ProjectSearch.contextTypes = {
shortcuts: _propTypes2.default.object
};
@@ -33669,7 +33478,7 @@ TextSearch.contextTypes = {
"use strict";
-var _svgInlineReact = __webpack_require__(1786);
+var _svgInlineReact = __webpack_require__(1764);
var _svgInlineReact2 = _interopRequireDefault(_svgInlineReact);
@@ -33694,7 +33503,7 @@ const svg = {
domain: __webpack_require__(353),
file: __webpack_require__(354),
folder: __webpack_require__(355),
- function: __webpack_require__(1777),
+ function: __webpack_require__(1788),
globe: __webpack_require__(356),
jquery: __webpack_require__(999),
underscore: __webpack_require__(1117),
@@ -35693,7 +35502,7 @@ class Editor extends _react.PureComponent {
// Only update and jump around in real source texts. This will
// keep the jump state around until the real source text is
// loaded.
- if (selectedSource && (0, _source.isLoaded)(selectedSource.toJS())) {
+ if (selectedSource && (0, _source.isLoaded)(selectedSource)) {
this.highlightLine();
}
@@ -35820,7 +35629,7 @@ class Editor extends _react.PureComponent {
return this.showMessage("");
}
- if (!(0, _source.isLoaded)(selectedSource.toJS())) {
+ if (!(0, _source.isLoaded)(selectedSource)) {
return (0, _editor.showLoading)(this.state.editor);
}
@@ -35864,7 +35673,7 @@ class Editor extends _react.PureComponent {
renderHitCounts() {
const { hitCount, selectedSource } = this.props;
- if (!selectedSource || !(0, _source.isLoaded)(selectedSource.toJS()) || !hitCount || !this.state.editor) {
+ if (!selectedSource || !(0, _source.isLoaded)(selectedSource) || !hitCount || !this.state.editor) {
return;
}
@@ -35879,7 +35688,7 @@ class Editor extends _react.PureComponent {
const { selectedSource, horizontal } = this.props;
const { editor } = this.state;
- if (!editor || !selectedSource || !(0, _source.isLoaded)(selectedSource.toJS())) {
+ if (!editor || !selectedSource || !(0, _source.isLoaded)(selectedSource)) {
return null;
}
@@ -36004,7 +35813,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
class SourceFooter extends _react.PureComponent {
prettyPrintButton() {
const { selectedSource, togglePrettyPrint } = this.props;
- const sourceLoaded = selectedSource && (0, _source.isLoaded)(selectedSource.toJS());
+ const sourceLoaded = selectedSource && (0, _source.isLoaded)(selectedSource);
if (!(0, _editor.shouldShowPrettyPrint)(selectedSource)) {
return;
@@ -36019,7 +35828,7 @@ class SourceFooter extends _react.PureComponent {
onClick: () => togglePrettyPrint(selectedSource.get("id")),
className: (0, _classnames2.default)("action", type, {
active: sourceLoaded,
- pretty: (0, _source.isPretty)(selectedSource.toJS())
+ pretty: (0, _source.isPretty)(selectedSource)
}),
key: type,
title: tooltip,
@@ -36031,7 +35840,7 @@ class SourceFooter extends _react.PureComponent {
blackBoxButton() {
const { selectedSource, toggleBlackBox } = this.props;
- const sourceLoaded = selectedSource && (0, _source.isLoaded)(selectedSource.toJS());
+ const sourceLoaded = selectedSource && (0, _source.isLoaded)(selectedSource);
if (!(0, _devtoolsConfig.isEnabled)("blackbox") || !sourceLoaded) {
return;
@@ -36652,7 +36461,7 @@ class Preview extends _react.PureComponent {
onMouseOver(e) {
const { target } = e;
if (this.props.selectedFrameVisible) {
- (0, _editor.updatePreview)(target, this.props.editor, this.props);
+ this.props.updatePreview(target, this.props.editor);
}
}
@@ -36708,19 +36517,18 @@ class Preview extends _react.PureComponent {
const {
addExpression,
loadObjectProperties,
- setPreview,
+ updatePreview,
clearPreview
} = _actions2.default;
exports.default = (0, _reactRedux.connect)(state => ({
preview: (0, _selectors.getPreview)(state),
selectedSource: (0, _selectors.getSelectedSource)(state),
- linesInScope: (0, _selectors.getInScopeLines)(state),
selectedFrameVisible: (0, _selectors.isSelectedFrameVisible)(state)
}), {
addExpression,
loadObjectProperties,
- setPreview,
+ updatePreview,
clearPreview
})(Preview);
@@ -36764,6 +36572,10 @@ var _PreviewFunction2 = _interopRequireDefault(_PreviewFunction);
var _editor = __webpack_require__(1358);
+var _Svg = __webpack_require__(1359);
+
+var _Svg2 = _interopRequireDefault(_Svg);
+
__webpack_require__(1328);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -36839,8 +36651,9 @@ class Popup extends _react.Component {
}
renderObjectPreview(expression, root, extra) {
- let reactHeader = null;
+ let header = null;
const { loadedObjects } = this.props;
+ const { extra: { react, immutable } } = this.props;
const getObjectProperties = id => loadedObjects[id];
let roots = this.getChildren(root, getObjectProperties);
@@ -36849,25 +36662,48 @@ class Popup extends _react.Component {
}
if (isReactComponent(roots)) {
- if (typeof extra !== "undefined") {
- reactHeader = _react2.default.createElement(
- "div",
- { className: "header-container" },
- _react2.default.createElement(
- "h3",
- null,
- extra
- )
- );
- }
+ const reactHeader = react.displayName || "React Component";
+
+ header = _react2.default.createElement(
+ "div",
+ { className: "header-container" },
+ _react2.default.createElement(
+ "h3",
+ null,
+ reactHeader
+ )
+ );
roots = roots.filter(r => ["state", "props"].includes(r.name));
}
+ if (immutable.isImmutable) {
+ const immutableHeader = immutable.type || "Immutable";
+
+ header = _react2.default.createElement(
+ "div",
+ { className: "header-container" },
+ _react2.default.createElement(_Svg2.default, { name: "immutable", className: "immutable-logo" }),
+ _react2.default.createElement(
+ "h3",
+ null,
+ immutableHeader
+ )
+ );
+
+ roots = roots.filter(r => ["size"].includes(r.name));
+
+ roots.push({
+ name: "entries",
+ contents: { value: immutable.entries },
+ path: "entries"
+ });
+ }
+
return _react2.default.createElement(
"div",
{ className: "preview-popup" },
- reactHeader,
+ header,
this.renderObjectInspector(roots)
);
}
@@ -39626,7 +39462,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
class Breakpoints extends _react.Component {
shouldComponentUpdate(nextProps) {
- if (nextProps.selectedSource && !(0, _source.isLoaded)(nextProps.selectedSource.toJS())) {
+ if (nextProps.selectedSource && !(0, _source.isLoaded)(nextProps.selectedSource)) {
return false;
}
@@ -40545,22 +40381,22 @@ Object.defineProperty(exports, "__esModule", {
var _react = __webpack_require__(0);
+var _reactRedux = __webpack_require__(1189);
+
var _devtoolsLaunchpad = __webpack_require__(1362);
var _devtoolsSourceMap = __webpack_require__(1360);
var _clipboard = __webpack_require__(1388);
-var _source = __webpack_require__(1356);
-
-var _editor = __webpack_require__(1358);
-
-var _reactRedux = __webpack_require__(1189);
-
var _function = __webpack_require__(1597);
var _astBreakpointLocation = __webpack_require__(1416);
+var _editor = __webpack_require__(1358);
+
+var _source = __webpack_require__(1356);
+
var _selectors = __webpack_require__(1352);
var _actions = __webpack_require__(1354);
@@ -40574,42 +40410,53 @@ function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in ob
* file, You can obtain one at . */
function getMenuItems(event, {
+ addExpression,
editor,
+ flashLineRange,
+ getFunctionLocation,
+ getFunctionText,
+ hasPrettyPrint,
+ jumpToMappedLocation,
+ onGutterContextMenu,
selectedLocation,
selectedSource,
showSource,
- onGutterContextMenu,
- jumpToMappedLocation,
- toggleBlackBox,
- addExpression,
- getFunctionText,
- getFunctionLocation,
- flashLineRange,
- hasPrettyPrint
+ toggleBlackBox
}) {
- const copySourceLabel = L10N.getStr("copySource");
- const copySourceKey = L10N.getStr("copySource.accesskey");
- const copyFunctionLabel = L10N.getStr("copyFunction.label");
- const copyFunctionKey = L10N.getStr("copyFunction.accesskey");
- const copySourceUri2Label = L10N.getStr("copySourceUri2");
- const copySourceUri2Key = L10N.getStr("copySourceUri2.accesskey");
- const revealInTreeLabel = L10N.getStr("sourceTabs.revealInTree");
- const revealInTreeKey = L10N.getStr("sourceTabs.revealInTree.accesskey");
+ // variables
+ const hasSourceMap = !!selectedSource.get("sourceMapURL");
+ const isOriginal = (0, _devtoolsSourceMap.isOriginalId)(selectedLocation.sourceId);
+ const isPrettyPrinted = (0, _source.isPretty)(selectedSource);
+ const isPrettified = isPrettyPrinted || hasPrettyPrint;
+ const isMapped = isOriginal || hasSourceMap;
+ const { line } = editor.codeMirror.coordsChar({
+ left: event.clientX,
+ top: event.clientY
+ });
+ const selectionText = editor.codeMirror.getSelection().trim();
+ const sourceLocation = (0, _editor.getSourceLocationFromMouseEvent)(editor, selectedLocation, event);
+ const textSelected = editor.codeMirror.somethingSelected();
+
+ // localizations
+ const blackboxKey = L10N.getStr("sourceFooter.blackbox.accesskey");
const blackboxLabel = L10N.getStr("sourceFooter.blackbox");
const unblackboxLabel = L10N.getStr("sourceFooter.unblackbox");
- const blackboxKey = L10N.getStr("sourceFooter.blackbox.accesskey");
const toggleBlackBoxLabel = selectedSource.get("isBlackBoxed") ? unblackboxLabel : blackboxLabel;
+ const copyFunctionKey = L10N.getStr("copyFunction.accesskey");
+ const copyFunctionLabel = L10N.getStr("copyFunction.label");
+ const copySourceKey = L10N.getStr("copySource.accesskey");
+ const copySourceLabel = L10N.getStr("copySource");
+ const copySourceUri2Key = L10N.getStr("copySourceUri2.accesskey");
+ const copySourceUri2Label = L10N.getStr("copySourceUri2");
+ const jumpToMappedLocKey = L10N.getStr("editor.jumpToMappedLocation1.accesskey");
+ const jumpToMappedLocLabel = L10N.getFormatStr("editor.jumpToMappedLocation1", isOriginal ? L10N.getStr("generated") : L10N.getStr("original"));
+ const revealInTreeKey = L10N.getStr("sourceTabs.revealInTree.accesskey");
+ const revealInTreeLabel = L10N.getStr("sourceTabs.revealInTree");
+ const watchExpressionKey = L10N.getStr("expressions.accesskey");
+ const watchExpressionLabel = L10N.getStr("expressions.label");
- const copySourceUri2 = {
- id: "node-menu-copy-source-url",
- label: copySourceUri2Label,
- accesskey: copySourceUri2Key,
- disabled: false,
- click: () => (0, _clipboard.copyToTheClipboard)(selectedSource.get("url"))
- };
-
- const selectionText = editor.codeMirror.getSelection().trim();
- const copySource = {
+ // menu items
+ const copySourceItem = {
id: "node-menu-copy-source",
label: copySourceLabel,
accesskey: copySourceKey,
@@ -40617,56 +40464,16 @@ function getMenuItems(event, {
click: () => (0, _clipboard.copyToTheClipboard)(selectionText)
};
- const { line } = editor.codeMirror.coordsChar({
- left: event.clientX,
- top: event.clientY
- });
-
- const sourceLocation = (0, _editor.getSourceLocationFromMouseEvent)(editor, selectedLocation, event);
-
- const isOriginal = (0, _devtoolsSourceMap.isOriginalId)(selectedLocation.sourceId);
- const hasSourceMap = !!selectedSource.get("sourceMapURL");
- const isPrettyPrinted = (0, _source.isPretty)(selectedSource.toJS());
-
- const isPrettified = isPrettyPrinted || hasPrettyPrint;
- const isMapped = isOriginal || hasSourceMap;
-
- const jumpLabel = {
- id: "node-menu-jump",
- accesskey: L10N.getStr("editor.jumpToMappedLocation1.accesskey"),
- disabled: !isMapped && !isPrettified,
- label: L10N.getFormatStr("editor.jumpToMappedLocation1", isOriginal ? L10N.getStr("generated") : L10N.getStr("original")),
- click: () => jumpToMappedLocation(sourceLocation)
- };
-
- const watchExpressionLabel = {
- id: "node-menu-add-watch-expression",
- accesskey: L10N.getStr("expressions.accesskey"),
- label: L10N.getStr("expressions.label"),
- click: () => addExpression(editor.codeMirror.getSelection())
- };
-
- const blackBoxMenuItem = {
- id: "node-menu-blackbox",
- label: toggleBlackBoxLabel,
- accesskey: blackboxKey,
- disabled: isOriginal || isPrettyPrinted || hasSourceMap,
- click: () => toggleBlackBox(selectedSource.toJS())
- };
-
- // TODO: Find a new way to only add this for mapped sources?
- const textSelected = editor.codeMirror.somethingSelected();
-
- const showSourceMenuItem = {
- id: "node-menu-show-source",
- label: revealInTreeLabel,
- accesskey: revealInTreeKey,
- disabled: isPrettyPrinted,
- click: () => showSource(selectedSource.get("id"))
+ const copySourceUri2Item = {
+ id: "node-menu-copy-source-url",
+ label: copySourceUri2Label,
+ accesskey: copySourceUri2Key,
+ disabled: false,
+ click: () => (0, _clipboard.copyToTheClipboard)(selectedSource.get("url"))
};
const functionText = getFunctionText(line + 1);
- const copyFunction = {
+ const copyFunctionItem = {
id: "node-menu-copy-function",
label: copyFunctionLabel,
accesskey: copyFunctionKey,
@@ -40682,10 +40489,44 @@ function getMenuItems(event, {
}
};
- const menuItems = [copySource, copySourceUri2, copyFunction, { type: "separator" }, jumpLabel, showSourceMenuItem, blackBoxMenuItem];
+ const jumpToMappedLocationItem = {
+ id: "node-menu-jump",
+ label: jumpToMappedLocLabel,
+ accesskey: jumpToMappedLocKey,
+ disabled: !isMapped && !isPrettified,
+ click: () => jumpToMappedLocation(sourceLocation)
+ };
+ const showSourceMenuItem = {
+ id: "node-menu-show-source",
+ label: revealInTreeLabel,
+ accesskey: revealInTreeKey,
+ disabled: isPrettyPrinted,
+ click: () => showSource(selectedSource.get("id"))
+ };
+
+ const blackBoxMenuItem = {
+ id: "node-menu-blackbox",
+ label: toggleBlackBoxLabel,
+ accesskey: blackboxKey,
+ disabled: isOriginal || isPrettyPrinted || hasSourceMap,
+ click: () => toggleBlackBox(selectedSource.toJS())
+ };
+
+ const watchExpressionItem = {
+ id: "node-menu-add-watch-expression",
+ label: watchExpressionLabel,
+ accesskey: watchExpressionKey,
+ click: () => addExpression(editor.codeMirror.getSelection())
+ };
+
+ // construct menu
+ const menuItems = [copySourceItem, copySourceUri2Item, copyFunctionItem, { type: "separator" }, jumpToMappedLocationItem, showSourceMenuItem, blackBoxMenuItem];
+
+ // conditionally added items
+ // TODO: Find a new way to only add this for mapped sources?
if (textSelected) {
- menuItems.push(watchExpressionLabel);
+ menuItems.push(watchExpressionItem);
}
return menuItems;
@@ -40721,11 +40562,11 @@ class EditorMenu extends _react.PureComponent {
const {
addExpression,
+ flashLineRange,
jumpToMappedLocation,
- toggleBlackBox,
setContextMenu,
showSource,
- flashLineRange
+ toggleBlackBox
} = _actions2.default;
exports.default = (0, _reactRedux.connect)(state => {
@@ -40743,11 +40584,11 @@ exports.default = (0, _reactRedux.connect)(state => {
};
}, {
addExpression,
+ flashLineRange,
jumpToMappedLocation,
- toggleBlackBox,
setContextMenu,
showSource,
- flashLineRange
+ toggleBlackBox
})(EditorMenu);
/***/ }),
@@ -41062,7 +40903,7 @@ var _UtilsBar = __webpack_require__(1609);
var _UtilsBar2 = _interopRequireDefault(_UtilsBar);
-var _BreakpointsDropdown = __webpack_require__(1778);
+var _BreakpointsDropdown = __webpack_require__(1791);
var _BreakpointsDropdown2 = _interopRequireDefault(_BreakpointsDropdown);
@@ -42653,7 +42494,7 @@ var _actions = __webpack_require__(1354);
var _actions2 = _interopRequireDefault(_actions);
-var _CommandBarButton = __webpack_require__(1787);
+var _CommandBarButton = __webpack_require__(1765);
var _CommandBarButton2 = _interopRequireDefault(_CommandBarButton);
@@ -43172,7 +43013,7 @@ var _actions2 = _interopRequireDefault(_actions);
var _selectors = __webpack_require__(1352);
-var _scopes = __webpack_require__(1780);
+var _scopes = __webpack_require__(1793);
var _devtoolsReps = __webpack_require__(1408);
@@ -43578,7 +43419,7 @@ class SourceTabs extends _react.PureComponent {
return;
}
- const isPrettySource = (0, _source.isPretty)(sourceTab.toJS());
+ const isPrettySource = (0, _source.isPretty)(sourceTab);
const closeTabMenuItem = {
id: "node-menu-close-tab",
@@ -43678,20 +43519,24 @@ class SourceTabs extends _react.PureComponent {
}
getIconClass(source) {
- if ((0, _source.isPretty)(source.toJS())) return "prettyPrint";
- if (source.get("isBlackBoxed")) return "blackBox";
+ if ((0, _source.isPretty)(source)) {
+ return "prettyPrint";
+ }
+ if (source.get("isBlackBoxed")) {
+ return "blackBox";
+ }
return "file";
}
renderDropdownSource(source) {
- const { selectLocation } = this.props;
+ const { selectSource } = this.props;
const filename = (0, _source.getFilename)(source.toJS());
- const onClick = () => selectLocation({ sourceId: source.get("id"), line: 0 });
+ const onClick = () => selectSource(source.get("id"));
return _react2.default.createElement(
"li",
{ key: source.get("id"), onClick: onClick },
- _react2.default.createElement("img", { className: "dropdown-icon " + this.getIconClass(source) }),
+ _react2.default.createElement("img", { className: `dropdown-icon ${this.getIconClass(source)}` }),
filename
);
}
@@ -43756,10 +43601,10 @@ class SourceTabs extends _react.PureComponent {
}
renderSourceTab(source) {
- const { selectedSource, selectLocation, closeTab } = this.props;
+ const { selectedSource, selectSource, closeTab } = this.props;
const filename = (0, _source.getFilename)(source.toJS());
const active = selectedSource && source.get("id") == selectedSource.get("id") && !this.isProjectSearchEnabled() && !this.isSourceSearchEnabled();
- const isPrettyCode = (0, _source.isPretty)(source.toJS());
+ const isPrettyCode = (0, _source.isPretty)(source);
const sourceAnnotation = this.getSourceAnnotation(source);
function onClickClose(ev) {
@@ -43777,7 +43622,7 @@ class SourceTabs extends _react.PureComponent {
{
className: className,
key: source.get("id"),
- onClick: () => selectLocation({ sourceId: source.get("id") }),
+ onClick: () => selectSource(source.get("id")),
onContextMenu: e => this.onTabContextMenu(e, source.get("id")),
title: (0, _source.getFileURL)(source.toJS())
},
@@ -43831,17 +43676,16 @@ class SourceTabs extends _react.PureComponent {
}
getSourceAnnotation(source) {
- const sourceObj = source.toJS();
const sourceId = source.get("id");
const sourceMetaData = this.props.sourceTabsMetaData[sourceId];
if (sourceMetaData && sourceMetaData.isReactComponent) {
return _react2.default.createElement("img", { className: "react" });
}
- if ((0, _source.isPretty)(sourceObj)) {
+ if ((0, _source.isPretty)(source)) {
return _react2.default.createElement("img", { className: "prettyPrint" });
}
- if (sourceObj.isBlackBoxed) {
+ if (source.get("isBlackBoxed")) {
return _react2.default.createElement("img", { className: "blackBox" });
}
}
@@ -44136,12 +43980,15 @@ function formatSymbols(symbols) {
}
function formatSources(sources) {
- return sources.valueSeq().toJS().filter(source => !(0, _source.isPretty)(source) && !(0, _source.isThirdParty)(source)).map(source => ({
- value: (0, _source.getSourcePath)(source),
- title: (0, _source.getSourcePath)(source).split("/").pop(),
- subtitle: (0, _utils.endTruncateStr)((0, _source.getSourcePath)(source), 100),
- id: source.id
- })).filter(formattedSource => formattedSource.value != "");
+ return sources.valueSeq().filter(source => !(0, _source.isPretty)(source) && !(0, _source.isThirdParty)(source)).map(source => {
+ const sourcePath = (0, _source.getSourcePath)(source.get("url"));
+ return {
+ value: sourcePath,
+ title: sourcePath.split("/").pop(),
+ subtitle: (0, _utils.endTruncateStr)(sourcePath, 100),
+ id: source.get("id")
+ };
+ }).filter(({ value }) => value != "").toJS();
}
/***/ }),
@@ -44740,25 +44587,25 @@ function closeQuickOpen() {
/* 1648 */
/***/ (function(module, exports) {
-module.exports = ""
+module.exports = ""
/***/ }),
/* 1649 */
/***/ (function(module, exports) {
-module.exports = ""
+module.exports = ""
/***/ }),
/* 1650 */
/***/ (function(module, exports) {
-module.exports = ""
+module.exports = ""
/***/ }),
/* 1651 */
/***/ (function(module, exports) {
-module.exports = ""
+module.exports = ""
/***/ }),
/* 1652 */
@@ -45161,23 +45008,31 @@ exports.fetchScopes = fetchScopes;
var _selectors = __webpack_require__(1352);
-var _pause = __webpack_require__(1400);
-
var _prefs = __webpack_require__(226);
var _devtoolsSourceMap = __webpack_require__(1360);
var _loadSourceText = __webpack_require__(1435);
+var _parser = __webpack_require__(1365);
+
+var _updateScopeBindings = __webpack_require__(1785);
+
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at . */
+
function mapScopes(scopes, frame) {
return async function ({ dispatch, getState, client, sourceMaps }) {
- const mappedScopes = await (0, _pause.updateScopeBindings)(scopes, frame.generatedLocation, frame.location, {
- async getLocationScopes(location, astScopes) {
+ const mappedScopes = await (0, _updateScopeBindings.updateScopeBindings)(scopes, frame.generatedLocation, frame.location, {
+ async getSourceMapsScopes(location) {
+ const astScopes = await (0, _parser.getScopes)(location);
return sourceMaps.getLocationScopes(location, astScopes);
},
- async loadSourceText(sourceId) {
- const source = (0, _selectors.getSource)(getState(), sourceId).toJS();
+ async getOriginalSourceScopes(location) {
+ const source = (0, _selectors.getSource)(getState(), location.sourceId);
await dispatch((0, _loadSourceText.loadSourceText)(source));
+ return (0, _parser.getScopes)(location);
}
});
@@ -45187,10 +45042,9 @@ function mapScopes(scopes, frame) {
scopes: mappedScopes
});
};
-} /* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at . */
+}
+// eslint-disable-next-line max-len
function fetchScopes() {
return async function ({ dispatch, getState, client, sourceMaps }) {
const frame = (0, _selectors.getSelectedFrame)(getState());
@@ -45747,7 +45601,7 @@ exports.default = Badge;
/* 1733 */
/***/ (function(module, exports) {
-module.exports = ""
+module.exports = ""
/***/ }),
/* 1734 */,
@@ -45780,137 +45634,6 @@ module.exports = "