зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1452748 - Update Debugger Frontend v33. r=jdescottes
MozReview-Commit-ID: 6kHP1gMaY07
This commit is contained in:
Родитель
cc035fe9e0
Коммит
14cece73ee
|
@ -1,9 +1,9 @@
|
|||
This is the debugger.html project output.
|
||||
See https://github.com/devtools-html/debugger.html
|
||||
|
||||
Version 32.0
|
||||
Version 33.0
|
||||
|
||||
Comparison: https://github.com/devtools-html/debugger.html/compare/release-31...release-32
|
||||
Comparison: https://github.com/devtools-html/debugger.html/compare/release-32...release-33
|
||||
|
||||
Packages:
|
||||
- babel-plugin-transform-es2015-modules-commonjs @6.26.0
|
||||
|
|
|
@ -326,6 +326,18 @@ menuseparator {
|
|||
--reference-color: var(--theme-highlight-purple);
|
||||
}
|
||||
|
||||
.theme-firebug {
|
||||
--number-color: #000088;
|
||||
--string-color: #ff0000;
|
||||
--null-color: #787878;
|
||||
--object-color: DarkGreen;
|
||||
--caption-color: #444444;
|
||||
--location-color: #555555;
|
||||
--source-link-color: blue;
|
||||
--node-color: rgb(0, 0, 136);
|
||||
--reference-color: rgb(102, 102, 255);
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
.objectLink:hover {
|
||||
|
@ -1912,6 +1924,18 @@ html .toggle-button.end.vertical svg {
|
|||
--stack-function-color: var(--theme-highlight-red);
|
||||
}
|
||||
|
||||
.theme-firebug {
|
||||
--number-color: #000088;
|
||||
--string-color: #FF0000;
|
||||
--null-color: #787878;
|
||||
--object-color: DarkGreen;
|
||||
--caption-color: #444444;
|
||||
--location-color: #555555;
|
||||
--source-link-color: blue;
|
||||
--node-color: rgb(0, 0, 136);
|
||||
--reference-color: rgb(102, 102, 255);
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
.inline {
|
||||
|
@ -2749,20 +2773,32 @@ debug-expression-error {
|
|||
user-select: none;
|
||||
}
|
||||
|
||||
.breakpoints-list .breakpoint-heading {
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.breakpoints-list .breakpoint-heading,
|
||||
.breakpoints-list .breakpoint {
|
||||
font-size: 12px;
|
||||
color: var(--theme-content-color1);
|
||||
padding: 0.5em 1em 0.5em 0.5em;
|
||||
line-height: 1em;
|
||||
position: relative;
|
||||
transition: all 0.25s ease;
|
||||
padding: 0.5em 1em 0.5em 0.5em;
|
||||
}
|
||||
|
||||
html[dir="rtl"] .breakpoints-list .breakpoint {
|
||||
.breakpoints-list .breakpoint {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
html[dir="rtl"] .breakpoints-list .breakpoint,
|
||||
html[dir="rtl"] .breakpoints-list .breakpoint-heading {
|
||||
border-right: 4px solid transparent;
|
||||
}
|
||||
|
||||
html:not([dir="rtl"]) .breakpoints-list .breakpoint {
|
||||
html:not([dir="rtl"]) .breakpoints-list .breakpoint,
|
||||
html:not([dir="rtl"]) .breakpoints-list .breakpoint-heading {
|
||||
border-left: 4px solid transparent;
|
||||
}
|
||||
|
||||
|
@ -2792,6 +2828,28 @@ html .breakpoints-list .breakpoint.paused {
|
|||
background-color: var(--search-overlays-semitransparent);
|
||||
}
|
||||
|
||||
.breakpoints-list .breakpoint .breakpoint-line,
|
||||
.breakpoints-list .breakpoint-label {
|
||||
font-family: var(--monospace-font-family);
|
||||
}
|
||||
|
||||
.breakpoints-list .breakpoint .breakpoint-line {
|
||||
font-size: 11px;
|
||||
color: var(--theme-comment);
|
||||
padding-top: 3px;
|
||||
padding-inline-end: 2px;
|
||||
min-width: 14px;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
html[dir="rtl"] .breakpoints-list .breakpoint .breakpoint-line {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.breakpoints-list .breakpoint:hover .breakpoint-line {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.breakpoints-list .breakpoint.paused:hover {
|
||||
border-color: var(--breakpoint-active-color-hover);
|
||||
}
|
||||
|
@ -2800,7 +2858,12 @@ html .breakpoints-list .breakpoint.paused {
|
|||
max-width: calc(100% - var(--breakpoint-expression-right-clear-space));
|
||||
display: inline-block;
|
||||
padding-inline-start: 2px;
|
||||
padding-inline-end: 8px;
|
||||
cursor: default;
|
||||
flex-grow: 1;
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
padding-top: 3px;
|
||||
}
|
||||
|
||||
.breakpoint-label .breakpoint-checkbox {
|
||||
|
@ -2827,6 +2890,11 @@ html .breakpoints-list .breakpoint.paused {
|
|||
offset-inline-end: 13px;
|
||||
offset-inline-start: auto;
|
||||
top: 9px;
|
||||
display: none;
|
||||
}
|
||||
|
||||
.breakpoint:hover .close-btn {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.breakpoint .close {
|
||||
|
@ -2836,6 +2904,30 @@ html .breakpoints-list .breakpoint.paused {
|
|||
.breakpoint:hover .close {
|
||||
visibility: visible;
|
||||
}
|
||||
|
||||
.CodeMirror.cm-s-mozilla-breakpoint .CodeMirror-lines {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.CodeMirror.cm-s-mozilla-breakpoint .CodeMirror-sizer {
|
||||
min-width: initial !important;
|
||||
}
|
||||
|
||||
.breakpoints-list .breakpoint.disabled .CodeMirror.cm-s-mozilla-breakpoint {
|
||||
transition: opacity 0.5s linear;
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
.CodeMirror.cm-s-mozilla-breakpoint .CodeMirror-line span[role=presentation] {
|
||||
max-width: 100%;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.CodeMirror.cm-s-mozilla-breakpoint .CodeMirror-code {
|
||||
cursor: default;
|
||||
}
|
||||
/* 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 <http://mozilla.org/MPL/2.0/>. */
|
||||
|
@ -2917,6 +3009,10 @@ html .breakpoints-list .breakpoint.paused {
|
|||
background-color: var(--theme-selection-background-hover);
|
||||
}
|
||||
|
||||
:root.theme-firebug .expression-container:hover {
|
||||
background-color: var(--theme-selection-background-hover);
|
||||
}
|
||||
|
||||
.tree .tree-node:not(.focused):hover {
|
||||
background-color: transparent;
|
||||
}
|
||||
|
@ -3062,7 +3158,8 @@ html .breakpoints-list .breakpoint.paused {
|
|||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.theme-light .frames .location {
|
||||
.theme-light .frames .location,
|
||||
.theme-firebug .frames .location {
|
||||
color: var(--theme-comment);
|
||||
}
|
||||
|
||||
|
@ -3097,6 +3194,7 @@ html .breakpoints-list .breakpoint.paused {
|
|||
}
|
||||
|
||||
:root.theme-light .frames ul li.selected .location,
|
||||
:root.theme-firebug .frames ul li.selected .location,
|
||||
:root.theme-dark .frames ul li.selected .location {
|
||||
color: white;
|
||||
}
|
||||
|
|
|
@ -3012,7 +3012,16 @@ module.exports = {
|
|||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.findScopeByName = exports.getASTLocation = undefined;
|
||||
exports.findScopeByName = exports.getASTLocation = exports.createEditor = undefined;
|
||||
|
||||
var _createEditor = __webpack_require__(3628);
|
||||
|
||||
Object.defineProperty(exports, "createEditor", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _createEditor.createEditor;
|
||||
}
|
||||
});
|
||||
|
||||
var _astBreakpointLocation = __webpack_require__(1416);
|
||||
|
||||
|
@ -5524,9 +5533,14 @@ function update(state = createPauseState(), action) {
|
|||
return _extends({}, state, { frames: action.frames });
|
||||
}
|
||||
|
||||
case "ADD_EXTRA":
|
||||
{
|
||||
return _extends({}, state, { extra: action.extra });
|
||||
}
|
||||
|
||||
case "ADD_SCOPES":
|
||||
{
|
||||
const { frame, extra, status, value } = action;
|
||||
const { frame, status, value } = action;
|
||||
const selectedFrameId = frame.id;
|
||||
|
||||
const generated = _extends({}, state.frameScopes.generated, {
|
||||
|
@ -5536,7 +5550,6 @@ function update(state = createPauseState(), action) {
|
|||
}
|
||||
});
|
||||
return _extends({}, state, {
|
||||
extra: extra,
|
||||
frameScopes: _extends({}, state.frameScopes, {
|
||||
generated
|
||||
})
|
||||
|
@ -6492,6 +6505,7 @@ function setSymbols(sourceId) {
|
|||
});
|
||||
|
||||
if ((0, _selectors.isPaused)(getState())) {
|
||||
await dispatch((0, _pause.setExtra)());
|
||||
await dispatch((0, _pause.mapFrames)());
|
||||
}
|
||||
|
||||
|
@ -7796,9 +7810,7 @@ function getASTLocation(source, symbols, location) {
|
|||
return { name: undefined, offset: location };
|
||||
}
|
||||
|
||||
const functions = [...symbols.functions];
|
||||
|
||||
const scope = (0, _ast.findClosestFunction)(functions, location);
|
||||
const scope = (0, _ast.findClosestFunction)(symbols, location);
|
||||
if (scope) {
|
||||
// we only record the line, but at some point we may
|
||||
// also do column offsets
|
||||
|
@ -8964,8 +8976,11 @@ const { Provider } = __webpack_require__(3592);
|
|||
function renderPanel(component, store) {
|
||||
const root = document.createElement("div");
|
||||
root.className = "launchpad-root theme-body";
|
||||
root.style.setProperty("flex", 1);
|
||||
root.style.setProperty("flex", "1");
|
||||
const mount = document.querySelector("#mount");
|
||||
if (!mount) {
|
||||
return;
|
||||
}
|
||||
mount.appendChild(root);
|
||||
|
||||
_reactDom2.default.render(_react2.default.createElement(Provider, { store }, _react2.default.createElement(component)), root);
|
||||
|
@ -9129,7 +9144,7 @@ var _selectors = __webpack_require__(3590);
|
|||
|
||||
var _source = __webpack_require__(1356);
|
||||
|
||||
var _sources = __webpack_require__(1797);
|
||||
var _loadSourceText = __webpack_require__(1435);
|
||||
|
||||
var _projectTextSearch = __webpack_require__(1424);
|
||||
|
||||
|
@ -9172,7 +9187,7 @@ function searchSources(query) {
|
|||
const sources = (0, _selectors.getSources)(getState());
|
||||
const validSources = sources.valueSeq().filter(source => !(0, _selectors.hasPrettySource)(getState(), source.id) && !(0, _source.isThirdParty)(source));
|
||||
for (const source of validSources) {
|
||||
await dispatch((0, _sources.loadSourceText)(source));
|
||||
await dispatch((0, _loadSourceText.loadSourceText)(source));
|
||||
await dispatch(searchSource(source.id, query));
|
||||
}
|
||||
dispatch(updateSearchStatus(_projectTextSearch.statusType.done));
|
||||
|
@ -22243,7 +22258,7 @@ exports.default = (0, _reactRedux.connect)(state => {
|
|||
hasPrettyPrint: !!(0, _selectors.getPrettySource)(state, selectedSource.get("id")),
|
||||
contextMenu: (0, _selectors.getContextMenu)(state),
|
||||
getFunctionText: line => (0, _function.findFunctionText)(line, selectedSource.toJS(), (0, _selectors.getSymbols)(state, selectedSource)),
|
||||
getFunctionLocation: line => (0, _ast.findClosestFunction)((0, _selectors.getSymbols)(state, selectedSource).functions, {
|
||||
getFunctionLocation: line => (0, _ast.findClosestFunction)((0, _selectors.getSymbols)(state, selectedSource), {
|
||||
line,
|
||||
column: Infinity
|
||||
})
|
||||
|
@ -22280,7 +22295,7 @@ var _indentation = __webpack_require__(1438);
|
|||
* file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
|
||||
|
||||
function findFunctionText(line, source, symbols) {
|
||||
const func = (0, _ast.findClosestFunction)(symbols.functions, {
|
||||
const func = (0, _ast.findClosestFunction)(symbols, {
|
||||
line,
|
||||
column: Infinity
|
||||
});
|
||||
|
@ -22899,26 +22914,18 @@ var _immutable = __webpack_require__(3594);
|
|||
|
||||
var I = _interopRequireWildcard(_immutable);
|
||||
|
||||
var _classnames = __webpack_require__(175);
|
||||
|
||||
var _classnames2 = _interopRequireDefault(_classnames);
|
||||
|
||||
var _reselect = __webpack_require__(993);
|
||||
|
||||
var _lodash = __webpack_require__(2);
|
||||
|
||||
var _BreakpointItem = __webpack_require__(3630);
|
||||
|
||||
var _BreakpointItem2 = _interopRequireDefault(_BreakpointItem);
|
||||
|
||||
var _actions = __webpack_require__(1354);
|
||||
|
||||
var _actions2 = _interopRequireDefault(_actions);
|
||||
|
||||
var _Close = __webpack_require__(1374);
|
||||
|
||||
var _Close2 = _interopRequireDefault(_Close);
|
||||
|
||||
var _utils = __webpack_require__(1366);
|
||||
|
||||
var _prefs = __webpack_require__(226);
|
||||
|
||||
var _source = __webpack_require__(1356);
|
||||
|
||||
var _selectors = __webpack_require__(3590);
|
||||
|
@ -22948,24 +22955,7 @@ function isCurrentlyPausedAtBreakpoint(frame, why, breakpoint) {
|
|||
}
|
||||
|
||||
function getBreakpointFilename(source) {
|
||||
return source && source.toJS ? (0, _source.getFilename)(source.toJS()) : "";
|
||||
}
|
||||
|
||||
function renderSourceLocation(source, line, column) {
|
||||
const filename = getBreakpointFilename(source);
|
||||
const isWasm = source && source.isWasm;
|
||||
const columnVal = _prefs.features.columnBreakpoints && column ? `:${column}` : "";
|
||||
const bpLocation = isWasm ? `0x${line.toString(16).toUpperCase()}` : `${line}${columnVal}`;
|
||||
|
||||
if (!filename) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return _react2.default.createElement(
|
||||
"div",
|
||||
{ className: "location" },
|
||||
`${(0, _utils.endTruncateStr)(filename, 30)}: ${bpLocation}`
|
||||
);
|
||||
return source ? (0, _source.getFilename)(source) : "";
|
||||
}
|
||||
|
||||
class Breakpoints extends _react.Component {
|
||||
|
@ -22996,62 +22986,45 @@ class Breakpoints extends _react.Component {
|
|||
}
|
||||
|
||||
renderBreakpoint(breakpoint) {
|
||||
const locationId = breakpoint.locationId;
|
||||
const line = breakpoint.location.line;
|
||||
const column = breakpoint.location.column;
|
||||
const isCurrentlyPaused = breakpoint.isCurrentlyPaused;
|
||||
const isDisabled = breakpoint.disabled;
|
||||
const isConditional = !!breakpoint.condition;
|
||||
const isHidden = breakpoint.hidden;
|
||||
|
||||
if (isHidden) {
|
||||
return;
|
||||
}
|
||||
return _react2.default.createElement(_BreakpointItem2.default, {
|
||||
key: breakpoint.locationId,
|
||||
breakpoint: breakpoint,
|
||||
onClick: () => this.selectBreakpoint(breakpoint),
|
||||
onContextMenu: e => (0, _BreakpointsContextMenu2.default)(_extends({}, this.props, { breakpoint, contextMenuEvent: e })),
|
||||
onChange: () => this.handleCheckbox(breakpoint),
|
||||
onCloseClick: ev => this.removeBreakpoint(ev, breakpoint)
|
||||
});
|
||||
}
|
||||
|
||||
renderEmpty() {
|
||||
return _react2.default.createElement(
|
||||
"div",
|
||||
{
|
||||
className: (0, _classnames2.default)({
|
||||
breakpoint,
|
||||
paused: isCurrentlyPaused,
|
||||
disabled: isDisabled,
|
||||
"is-conditional": isConditional
|
||||
}),
|
||||
key: locationId,
|
||||
onClick: () => this.selectBreakpoint(breakpoint),
|
||||
onContextMenu: e => (0, _BreakpointsContextMenu2.default)(_extends({}, this.props, { breakpoint, contextMenuEvent: e }))
|
||||
},
|
||||
_react2.default.createElement("input", {
|
||||
type: "checkbox",
|
||||
className: "breakpoint-checkbox",
|
||||
checked: !isDisabled,
|
||||
onChange: () => this.handleCheckbox(breakpoint),
|
||||
onClick: ev => ev.stopPropagation()
|
||||
}),
|
||||
_react2.default.createElement(
|
||||
"label",
|
||||
{ className: "breakpoint-label", title: breakpoint.text },
|
||||
renderSourceLocation(breakpoint.location.source, line, column)
|
||||
),
|
||||
_react2.default.createElement(_Close2.default, {
|
||||
handleClick: ev => this.removeBreakpoint(ev, breakpoint),
|
||||
tooltip: L10N.getStr("breakpoints.removeBreakpointTooltip")
|
||||
})
|
||||
{ className: "pane-info" },
|
||||
L10N.getStr("breakpoints.none")
|
||||
);
|
||||
}
|
||||
|
||||
renderBreakpoints() {
|
||||
const { breakpoints } = this.props;
|
||||
|
||||
const groupedBreakpoints = (0, _lodash.groupBy)((0, _lodash.sortBy)([...breakpoints.valueSeq()], bp => bp.location.line), bp => getBreakpointFilename(bp.source));
|
||||
|
||||
return [...Object.keys(groupedBreakpoints).map(filename => {
|
||||
return [_react2.default.createElement(
|
||||
"div",
|
||||
{ className: "breakpoint-heading", title: filename, key: filename },
|
||||
filename
|
||||
), ...groupedBreakpoints[filename].filter(bp => !bp.hidden && bp.text).map((bp, i) => this.renderBreakpoint(bp))];
|
||||
})];
|
||||
}
|
||||
|
||||
render() {
|
||||
const { breakpoints } = this.props;
|
||||
const children = breakpoints.size === 0 ? _react2.default.createElement(
|
||||
"div",
|
||||
{ className: "pane-info" },
|
||||
L10N.getStr("breakpoints.none")
|
||||
) : (0, _lodash.sortBy)([...breakpoints.valueSeq()], [bp => getBreakpointFilename(bp.location.source), bp => bp.location.line]).map(bp => this.renderBreakpoint(bp));
|
||||
|
||||
return _react2.default.createElement(
|
||||
"div",
|
||||
{ className: "pane breakpoints-list" },
|
||||
children
|
||||
breakpoints.size ? this.renderBreakpoints() : this.renderEmpty()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -23060,14 +23033,12 @@ function updateLocation(sources, frame, why, bp) {
|
|||
const source = (0, _selectors.getSourceInSources)(sources, bp.location.sourceId);
|
||||
const isCurrentlyPaused = isCurrentlyPausedAtBreakpoint(frame, why, bp);
|
||||
const locationId = (0, _breakpoint.makeLocationId)(bp.location);
|
||||
|
||||
const location = _extends({}, bp.location, { source });
|
||||
const localBP = _extends({}, bp, { location, locationId, isCurrentlyPaused });
|
||||
const localBP = _extends({}, bp, { locationId, isCurrentlyPaused, source });
|
||||
|
||||
return localBP;
|
||||
}
|
||||
|
||||
const _getBreakpoints = (0, _reselect.createSelector)(_selectors.getBreakpoints, _selectors.getSources, _selectors.getTopFrame, _selectors.getPauseReason, (breakpoints, sources, frame, why) => breakpoints.map(bp => updateLocation(sources, frame, why, bp)).filter(bp => bp.location.source && !bp.location.source.isBlackBoxed));
|
||||
const _getBreakpoints = (0, _reselect.createSelector)(_selectors.getBreakpoints, _selectors.getSources, _selectors.getTopFrame, _selectors.getPauseReason, (breakpoints, sources, frame, why) => breakpoints.map(bp => updateLocation(sources, frame, why, bp)).filter(bp => bp.source && !bp.source.isBlackBoxed));
|
||||
|
||||
exports.default = (0, _reactRedux.connect)((state, props) => ({ breakpoints: _getBreakpoints(state) }), dispatch => (0, _redux.bindActionCreators)(_actions2.default, dispatch))(Breakpoints);
|
||||
|
||||
|
@ -26509,6 +26480,7 @@ exports.findBestMatchExpression = findBestMatchExpression;
|
|||
exports.findEmptyLines = findEmptyLines;
|
||||
exports.containsPosition = containsPosition;
|
||||
exports.findClosestFunction = findClosestFunction;
|
||||
exports.findClosestClass = findClosestClass;
|
||||
|
||||
var _lodash = __webpack_require__(2);
|
||||
|
||||
|
@ -26554,8 +26526,12 @@ function containsPosition(a, b) {
|
|||
return startsBefore && endsAfter;
|
||||
}
|
||||
|
||||
function findClosestFunction(functions, location) {
|
||||
return functions.reduce((found, currNode) => {
|
||||
function findClosestofSymbol(declarations, location) {
|
||||
if (!declarations) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return declarations.reduce((found, currNode) => {
|
||||
if (currNode.name === "anonymous" || !containsPosition(currNode.location, {
|
||||
line: location.line,
|
||||
column: location.column || 0
|
||||
|
@ -26578,6 +26554,16 @@ function findClosestFunction(functions, location) {
|
|||
}, null);
|
||||
}
|
||||
|
||||
function findClosestFunction(symbols, location) {
|
||||
const { functions } = symbols;
|
||||
return findClosestofSymbol(functions, location);
|
||||
}
|
||||
|
||||
function findClosestClass(symbols, location) {
|
||||
const { classes } = symbols;
|
||||
return findClosestofSymbol(classes, location);
|
||||
}
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 1639:
|
||||
|
@ -26695,6 +26681,15 @@ Object.defineProperty(exports, "mapFrames", {
|
|||
}
|
||||
});
|
||||
|
||||
var _setExtra = __webpack_require__(3627);
|
||||
|
||||
Object.defineProperty(exports, "setExtra", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _setExtra.setExtra;
|
||||
}
|
||||
});
|
||||
|
||||
var _setPopupObjectProperties = __webpack_require__(2008);
|
||||
|
||||
Object.defineProperty(exports, "setPopupObjectProperties", {
|
||||
|
@ -26864,6 +26859,8 @@ var _expressions = __webpack_require__(1398);
|
|||
|
||||
var _sources = __webpack_require__(1797);
|
||||
|
||||
var _loadSourceText = __webpack_require__(1435);
|
||||
|
||||
var _ui = __webpack_require__(1385);
|
||||
|
||||
var _commands = __webpack_require__(1637);
|
||||
|
@ -26874,6 +26871,10 @@ var _mapFrames = __webpack_require__(1804);
|
|||
|
||||
var _fetchScopes = __webpack_require__(1655);
|
||||
|
||||
/* 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 <http://mozilla.org/MPL/2.0/>. */
|
||||
|
||||
async function getOriginalSourceForFrame(state, frame) {
|
||||
return (0, _selectors.getSources)(state).get(frame.location.sourceId);
|
||||
}
|
||||
|
@ -26884,10 +26885,6 @@ async function getOriginalSourceForFrame(state, frame) {
|
|||
* @memberof actions/pause
|
||||
* @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 <http://mozilla.org/MPL/2.0/>. */
|
||||
|
||||
function paused(pauseInfo) {
|
||||
return async function ({ dispatch, getState, client, sourceMaps }) {
|
||||
const { frames, why, loadedObjects } = pauseInfo;
|
||||
|
@ -26898,7 +26895,7 @@ function paused(pauseInfo) {
|
|||
const source = await getOriginalSourceForFrame(getState(), mappedFrame);
|
||||
|
||||
// Ensure that the original file has loaded if there is one.
|
||||
await dispatch((0, _sources.loadSourceText)(source));
|
||||
await dispatch((0, _loadSourceText.loadSourceText)(source));
|
||||
|
||||
if (await (0, _pause.shouldStep)(mappedFrame, getState(), sourceMaps)) {
|
||||
dispatch((0, _commands.command)("stepOver"));
|
||||
|
@ -27766,10 +27763,10 @@ var _selectors = __webpack_require__(3590);
|
|||
|
||||
var _mapScopes = __webpack_require__(1634);
|
||||
|
||||
var _preview = __webpack_require__(1786);
|
||||
|
||||
var _promise = __webpack_require__(1653);
|
||||
|
||||
var _setExtra = __webpack_require__(3627);
|
||||
|
||||
/* 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 <http://mozilla.org/MPL/2.0/>. */
|
||||
|
@ -27781,15 +27778,13 @@ function fetchScopes() {
|
|||
return;
|
||||
}
|
||||
|
||||
const extra = await dispatch((0, _preview.getExtra)("this;", frame.this, frame));
|
||||
|
||||
const scopes = dispatch({
|
||||
type: "ADD_SCOPES",
|
||||
frame,
|
||||
extra,
|
||||
[_promise.PROMISE]: client.getFrameScopes(frame)
|
||||
});
|
||||
|
||||
await dispatch((0, _setExtra.setExtra)());
|
||||
await dispatch((0, _mapScopes.mapScopes)(scopes, frame));
|
||||
};
|
||||
}
|
||||
|
@ -28252,7 +28247,7 @@ exports.log = log;
|
|||
|
||||
var _devtoolsConfig = __webpack_require__(1355);
|
||||
|
||||
const blacklist = ["SET_POPUP_OBJECT_PROPERTIES", "SET_PAUSE_POINTS", "SET_SYMBOLS", "OUT_OF_SCOPE_LOCATIONS", "MAP_SCOPES", "MAP_FRAMES", "ADD_SCOPES", "IN_SCOPE_LINES"];
|
||||
const blacklist = ["SET_POPUP_OBJECT_PROPERTIES", "SET_PAUSE_POINTS", "SET_SYMBOLS", "OUT_OF_SCOPE_LOCATIONS", "MAP_SCOPES", "MAP_FRAMES", "ADD_SCOPES", "IN_SCOPE_LINES", "REMOVE_BREAKPOINT", "ADD_BREAKPOINT"];
|
||||
|
||||
function cloneAction(action) {
|
||||
action = action || {};
|
||||
|
@ -30385,10 +30380,24 @@ async function getImmutableProps(expression, evaluate) {
|
|||
};
|
||||
}
|
||||
|
||||
async function getExtraProps(expression, result, evaluate) {
|
||||
async function getExtraProps(getState, expression, result, evaluate) {
|
||||
const props = {};
|
||||
if ((0, _preview.isReactComponent)(result)) {
|
||||
props.react = await getReactProps(evaluate);
|
||||
const selectedFrame = (0, _selectors.getSelectedFrame)(getState());
|
||||
const source = (0, _selectors.getSource)(getState(), selectedFrame.location.sourceId);
|
||||
const symbols = (0, _selectors.getSymbols)(getState(), source);
|
||||
|
||||
if (symbols && symbols.classes) {
|
||||
const originalClass = (0, _ast.findClosestClass)(symbols, selectedFrame.location);
|
||||
|
||||
if (originalClass) {
|
||||
props.react = { displayName: originalClass.name };
|
||||
}
|
||||
}
|
||||
|
||||
if (!props.react) {
|
||||
props.react = await getReactProps(evaluate);
|
||||
}
|
||||
}
|
||||
|
||||
if ((0, _preview.isImmutable)(result)) {
|
||||
|
@ -30420,7 +30429,7 @@ function isInvalidTarget(target) {
|
|||
|
||||
function getExtra(expression, result, selectedFrame) {
|
||||
return async ({ dispatch, getState, client, sourceMaps }) => {
|
||||
const extra = await getExtraProps(expression, result, expr => client.evaluateInFrame(selectedFrame.id, expr));
|
||||
const extra = await getExtraProps(getState, expression, result, expr => client.evaluateInFrame(selectedFrame.id, expr));
|
||||
|
||||
return extra;
|
||||
};
|
||||
|
@ -31888,7 +31897,7 @@ function mapDisplayNames(frames, getState) {
|
|||
return frame;
|
||||
}
|
||||
|
||||
const originalFunction = (0, _ast.findClosestFunction)(symbols.functions, frame.location);
|
||||
const originalFunction = (0, _ast.findClosestFunction)(symbols, frame.location);
|
||||
|
||||
if (!originalFunction) {
|
||||
return frame;
|
||||
|
@ -38781,6 +38790,110 @@ module.exports = __WEBPACK_EXTERNAL_MODULE_3626__;
|
|||
|
||||
/***/ }),
|
||||
|
||||
/***/ 3627:
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.setExtra = setExtra;
|
||||
|
||||
var _selectors = __webpack_require__(3590);
|
||||
|
||||
var _fetchExtra = __webpack_require__(3629);
|
||||
|
||||
function setExtra() {
|
||||
return async function ({ dispatch, getState, sourceMaps }) {
|
||||
const frame = (0, _selectors.getSelectedFrame)(getState());
|
||||
const source = (0, _selectors.getSource)(getState(), frame.location.sourceId);
|
||||
const symbols = (0, _selectors.getSymbols)(getState(), source);
|
||||
|
||||
if (symbols && symbols.classes) {
|
||||
dispatch((0, _fetchExtra.fetchExtra)());
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 3628:
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.createEditor = createEditor;
|
||||
|
||||
var _sourceEditor = __webpack_require__(197);
|
||||
|
||||
var _sourceEditor2 = _interopRequireDefault(_sourceEditor);
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function createEditor(value) {
|
||||
return new _sourceEditor2.default({
|
||||
mode: "javascript",
|
||||
foldGutter: false,
|
||||
enableCodeFolding: false,
|
||||
readOnly: "nocursor",
|
||||
lineNumbers: false,
|
||||
theme: "mozilla mozilla-breakpoint",
|
||||
styleActiveLine: false,
|
||||
lineWrapping: false,
|
||||
matchBrackets: false,
|
||||
showAnnotationRuler: false,
|
||||
gutters: false,
|
||||
value: value || "",
|
||||
scrollbarStyle: null
|
||||
});
|
||||
} /* 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 <http://mozilla.org/MPL/2.0/>. */
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 3629:
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.fetchExtra = fetchExtra;
|
||||
|
||||
var _selectors = __webpack_require__(3590);
|
||||
|
||||
var _preview = __webpack_require__(1786);
|
||||
|
||||
/* 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 <http://mozilla.org/MPL/2.0/>. */
|
||||
|
||||
function fetchExtra() {
|
||||
return async function ({ dispatch, getState }) {
|
||||
const frame = (0, _selectors.getSelectedFrame)(getState());
|
||||
if (!frame) {
|
||||
return;
|
||||
}
|
||||
|
||||
const extra = await dispatch((0, _preview.getExtra)("this;", frame.this, frame));
|
||||
dispatch({
|
||||
type: "ADD_EXTRA",
|
||||
extra: extra
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 363:
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
|
@ -38788,6 +38901,157 @@ module.exports = "<!-- This Source Code Form is subject to the terms of the Mozi
|
|||
|
||||
/***/ }),
|
||||
|
||||
/***/ 3630:
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
|
||||
var _react = __webpack_require__(0);
|
||||
|
||||
var _react2 = _interopRequireDefault(_react);
|
||||
|
||||
var _reactDom = __webpack_require__(4);
|
||||
|
||||
var _reactDom2 = _interopRequireDefault(_reactDom);
|
||||
|
||||
var _classnames = __webpack_require__(175);
|
||||
|
||||
var _classnames2 = _interopRequireDefault(_classnames);
|
||||
|
||||
var _Close = __webpack_require__(1374);
|
||||
|
||||
var _Close2 = _interopRequireDefault(_Close);
|
||||
|
||||
var _breakpoint = __webpack_require__(1364);
|
||||
|
||||
var _prefs = __webpack_require__(226);
|
||||
|
||||
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 <http://mozilla.org/MPL/2.0/>. */
|
||||
|
||||
function getBreakpointLocation(source, line, column) {
|
||||
const isWasm = source && source.isWasm;
|
||||
const columnVal = _prefs.features.columnBreakpoints && column ? `:${column}` : "";
|
||||
const bpLocation = isWasm ? `0x${line.toString(16).toUpperCase()}` : `${line}${columnVal}`;
|
||||
|
||||
return bpLocation;
|
||||
}
|
||||
|
||||
class BreakpointItem extends _react.Component {
|
||||
|
||||
componentDidMount() {
|
||||
this.setupEditor();
|
||||
}
|
||||
componentDidUpdate() {
|
||||
this.setupEditor();
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
if (this.editor) {
|
||||
this.editor.destroy();
|
||||
}
|
||||
}
|
||||
|
||||
shouldComponentUpdate(nextProps) {
|
||||
const prevBreakpoint = this.props.breakpoint;
|
||||
const nextBreakpoint = nextProps.breakpoint;
|
||||
|
||||
return !prevBreakpoint || prevBreakpoint.text != nextBreakpoint.text || prevBreakpoint.disabled != nextBreakpoint.disabled || prevBreakpoint.condition != nextBreakpoint.condition || prevBreakpoint.hidden != nextBreakpoint.hidden || prevBreakpoint.isCurrentlyPaused != nextBreakpoint.isCurrentlyPaused;
|
||||
}
|
||||
|
||||
setupEditor() {
|
||||
const { breakpoint } = this.props;
|
||||
if (this.editor) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.editor = (0, _breakpoint.createEditor)(breakpoint.text);
|
||||
|
||||
// disables the default search shortcuts
|
||||
// $FlowIgnore
|
||||
this.editor._initShortcuts = () => {};
|
||||
|
||||
const node = _reactDom2.default.findDOMNode(this);
|
||||
if (node instanceof HTMLElement) {
|
||||
const mountNode = node.querySelector(".breakpoint-label");
|
||||
if (node instanceof HTMLElement) {
|
||||
// $FlowIgnore
|
||||
mountNode.innerHTML = "";
|
||||
this.editor.appendToLocalElement(mountNode);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
const {
|
||||
breakpoint,
|
||||
onClick,
|
||||
onChange,
|
||||
onContextMenu,
|
||||
onCloseClick
|
||||
} = this.props;
|
||||
|
||||
const locationId = breakpoint.locationId;
|
||||
const line = breakpoint.location.line;
|
||||
const column = breakpoint.location.column;
|
||||
const isCurrentlyPaused = breakpoint.isCurrentlyPaused;
|
||||
const isDisabled = breakpoint.disabled;
|
||||
const isConditional = !!breakpoint.condition;
|
||||
|
||||
return _react2.default.createElement(
|
||||
"div",
|
||||
{
|
||||
className: (0, _classnames2.default)({
|
||||
breakpoint,
|
||||
paused: isCurrentlyPaused,
|
||||
disabled: isDisabled,
|
||||
"is-conditional": isConditional
|
||||
}),
|
||||
key: locationId,
|
||||
onClick: onClick,
|
||||
onContextMenu: onContextMenu
|
||||
},
|
||||
_react2.default.createElement("input", {
|
||||
type: "checkbox",
|
||||
className: "breakpoint-checkbox",
|
||||
checked: !isDisabled,
|
||||
onChange: onChange,
|
||||
onClick: ev => ev.stopPropagation()
|
||||
}),
|
||||
_react2.default.createElement(
|
||||
"label",
|
||||
{ className: "breakpoint-label", title: breakpoint.text },
|
||||
breakpoint.text
|
||||
),
|
||||
_react2.default.createElement(
|
||||
"div",
|
||||
{ className: "breakpoint-line-close" },
|
||||
_react2.default.createElement(
|
||||
"div",
|
||||
{ className: "breakpoint-line" },
|
||||
getBreakpointLocation(breakpoint.source, line, column)
|
||||
),
|
||||
_react2.default.createElement(_Close2.default, {
|
||||
handleClick: onCloseClick,
|
||||
tooltip: L10N.getStr("breakpoints.removeBreakpointTooltip")
|
||||
})
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
exports.default = BreakpointItem;
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 364:
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
|
|
|
@ -1249,6 +1249,11 @@ Object.defineProperty(exports, "__esModule", {
|
|||
exports.isFunction = isFunction;
|
||||
exports.isAwaitExpression = isAwaitExpression;
|
||||
exports.isYieldExpression = isYieldExpression;
|
||||
exports.isObjectShorthand = isObjectShorthand;
|
||||
exports.getObjectExpressionValue = getObjectExpressionValue;
|
||||
exports.getVariableNames = getVariableNames;
|
||||
exports.getComments = getComments;
|
||||
exports.getSpecifiers = getSpecifiers;
|
||||
exports.isVariable = isVariable;
|
||||
exports.isComputedExpression = isComputedExpression;
|
||||
exports.getMemberExpression = getMemberExpression;
|
||||
|
@ -1258,6 +1263,16 @@ var _types = __webpack_require__(2268);
|
|||
|
||||
var t = _interopRequireWildcard(_types);
|
||||
|
||||
var _generator = __webpack_require__(2365);
|
||||
|
||||
var _generator2 = _interopRequireDefault(_generator);
|
||||
|
||||
var _flatten = __webpack_require__(706);
|
||||
|
||||
var _flatten2 = _interopRequireDefault(_flatten);
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
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; } }
|
||||
|
||||
function isFunction(node) {
|
||||
|
@ -1276,6 +1291,75 @@ function isYieldExpression(path) {
|
|||
return t.isYieldExpression(node) || t.isYieldExpression(parent.init) || t.isYieldExpression(parent);
|
||||
}
|
||||
|
||||
function isObjectShorthand(parent) {
|
||||
return t.isProperty(parent) && parent.key.start == parent.value.start && parent.key.loc.identifierName === parent.value.loc.identifierName;
|
||||
}
|
||||
|
||||
function getObjectExpressionValue(node) {
|
||||
const { value } = node;
|
||||
|
||||
if (t.isIdentifier(value)) {
|
||||
return value.name;
|
||||
}
|
||||
|
||||
if (t.isCallExpression(value)) {
|
||||
return "";
|
||||
}
|
||||
const code = (0, _generator2.default)(value).code;
|
||||
|
||||
const shouldWrap = t.isObjectExpression(value);
|
||||
return shouldWrap ? `(${code})` : code;
|
||||
}
|
||||
|
||||
function getVariableNames(path) {
|
||||
if (t.isObjectProperty(path.node) && !isFunction(path.node.value)) {
|
||||
if (path.node.key.type === "StringLiteral") {
|
||||
return [{
|
||||
name: path.node.key.value,
|
||||
location: path.node.loc
|
||||
}];
|
||||
} else if (path.node.value.type === "Identifier") {
|
||||
return [{ name: path.node.value.name, location: path.node.loc }];
|
||||
} else if (path.node.value.type === "AssignmentPattern") {
|
||||
return [{ name: path.node.value.left.name, location: path.node.loc }];
|
||||
}
|
||||
|
||||
return [{
|
||||
name: path.node.key.name,
|
||||
location: path.node.loc
|
||||
}];
|
||||
}
|
||||
|
||||
if (!path.node.declarations) {
|
||||
return path.node.params.map(dec => ({
|
||||
name: dec.name,
|
||||
location: dec.loc
|
||||
}));
|
||||
}
|
||||
|
||||
const declarations = path.node.declarations.filter(dec => dec.id.type !== "ObjectPattern").map(getVariables);
|
||||
|
||||
return (0, _flatten2.default)(declarations);
|
||||
}
|
||||
|
||||
function getComments(ast) {
|
||||
if (!ast || !ast.comments) {
|
||||
return [];
|
||||
}
|
||||
return ast.comments.map(comment => ({
|
||||
name: comment.location,
|
||||
location: comment.loc
|
||||
}));
|
||||
}
|
||||
|
||||
function getSpecifiers(specifiers) {
|
||||
if (!specifiers) {
|
||||
return [];
|
||||
}
|
||||
|
||||
return specifiers.map(specifier => specifier.local && specifier.local.name);
|
||||
}
|
||||
|
||||
function isVariable(path) {
|
||||
const node = path.node;
|
||||
return t.isVariableDeclaration(node) || isFunction(path) && path.node.params != null && path.node.params.length || t.isObjectProperty(node) && !isFunction(path.node.value);
|
||||
|
@ -1446,10 +1530,6 @@ var _extends = Object.assign || function (target) { for (var i = 1; i < argument
|
|||
exports.clearSymbols = clearSymbols;
|
||||
exports.getSymbols = getSymbols;
|
||||
|
||||
var _flatten = __webpack_require__(706);
|
||||
|
||||
var _flatten2 = _interopRequireDefault(_flatten);
|
||||
|
||||
var _types = __webpack_require__(2268);
|
||||
|
||||
var t = _interopRequireWildcard(_types);
|
||||
|
@ -1468,10 +1548,10 @@ var _getFunctionName = __webpack_require__(1621);
|
|||
|
||||
var _getFunctionName2 = _interopRequireDefault(_getFunctionName);
|
||||
|
||||
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; } }
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
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; } }
|
||||
|
||||
let symbolDeclarations = new Map();
|
||||
|
||||
function getFunctionParameterNames(path) {
|
||||
|
@ -1498,59 +1578,10 @@ function getFunctionParameterNames(path) {
|
|||
return [];
|
||||
}
|
||||
|
||||
function getVariableNames(path) {
|
||||
if (t.isObjectProperty(path.node) && !(0, _helpers.isFunction)(path.node.value)) {
|
||||
if (path.node.key.type === "StringLiteral") {
|
||||
return [{
|
||||
name: path.node.key.value,
|
||||
location: path.node.loc
|
||||
}];
|
||||
} else if (path.node.value.type === "Identifier") {
|
||||
return [{ name: path.node.value.name, location: path.node.loc }];
|
||||
} else if (path.node.value.type === "AssignmentPattern") {
|
||||
return [{ name: path.node.value.left.name, location: path.node.loc }];
|
||||
}
|
||||
|
||||
return [{
|
||||
name: path.node.key.name,
|
||||
location: path.node.loc
|
||||
}];
|
||||
}
|
||||
|
||||
if (!path.node.declarations) {
|
||||
return path.node.params.map(dec => ({
|
||||
name: dec.name,
|
||||
location: dec.loc
|
||||
}));
|
||||
}
|
||||
|
||||
const declarations = path.node.declarations.filter(dec => dec.id.type !== "ObjectPattern").map(_helpers.getVariables);
|
||||
|
||||
return (0, _flatten2.default)(declarations);
|
||||
}
|
||||
|
||||
function getComments(ast) {
|
||||
if (!ast || !ast.comments) {
|
||||
return [];
|
||||
}
|
||||
return ast.comments.map(comment => ({
|
||||
name: comment.location,
|
||||
location: comment.loc
|
||||
}));
|
||||
}
|
||||
|
||||
function getSpecifiers(specifiers) {
|
||||
if (!specifiers) {
|
||||
return [];
|
||||
}
|
||||
|
||||
return specifiers.map(specifier => specifier.local && specifier.local.name);
|
||||
}
|
||||
|
||||
/* eslint-disable complexity */
|
||||
function extractSymbol(path, symbols) {
|
||||
if ((0, _helpers.isVariable)(path)) {
|
||||
symbols.variables.push(...getVariableNames(path));
|
||||
symbols.variables.push(...(0, _helpers.getVariableNames)(path));
|
||||
}
|
||||
|
||||
if ((0, _helpers.isFunction)(path)) {
|
||||
|
@ -1583,7 +1614,7 @@ function extractSymbol(path, symbols) {
|
|||
symbols.imports.push({
|
||||
source: path.node.source.value,
|
||||
location: path.node.loc,
|
||||
specifiers: getSpecifiers(path.node.specifiers)
|
||||
specifiers: (0, _helpers.getSpecifiers)(path.node.specifiers)
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -1629,6 +1660,15 @@ function extractSymbol(path, symbols) {
|
|||
}
|
||||
}
|
||||
|
||||
if (t.isStringLiteral(path) && t.isProperty(path.parentPath)) {
|
||||
const { start, end } = path.node.loc;
|
||||
return symbols.identifiers.push({
|
||||
name: path.node.value,
|
||||
expression: (0, _helpers.getObjectExpressionValue)(path.parent),
|
||||
location: { start, end }
|
||||
});
|
||||
}
|
||||
|
||||
if (t.isIdentifier(path) && !t.isGenericTypeAnnotation(path.parent)) {
|
||||
let { start, end } = path.node.loc;
|
||||
|
||||
|
@ -1637,8 +1677,12 @@ function extractSymbol(path, symbols) {
|
|||
return;
|
||||
}
|
||||
|
||||
if (t.isProperty(path.parent)) {
|
||||
return;
|
||||
if (t.isProperty(path.parentPath) && !(0, _helpers.isObjectShorthand)(path.parent)) {
|
||||
return symbols.identifiers.push({
|
||||
name: path.node.name,
|
||||
expression: (0, _helpers.getObjectExpressionValue)(path.parent),
|
||||
location: { start, end }
|
||||
});
|
||||
}
|
||||
|
||||
if (path.node.typeAnnotation) {
|
||||
|
@ -1708,7 +1752,7 @@ function extractSymbols(sourceId) {
|
|||
});
|
||||
|
||||
// comments are extracted separately from the AST
|
||||
symbols.comments = getComments(ast);
|
||||
symbols.comments = (0, _helpers.getComments)(ast);
|
||||
|
||||
return symbols;
|
||||
}
|
||||
|
|
|
@ -100,6 +100,8 @@ support-files =
|
|||
examples/doc-minified.html
|
||||
examples/big-sourcemap.html
|
||||
examples/doc-minified2.html
|
||||
examples/doc-on-load.html
|
||||
examples/doc-preview.html
|
||||
examples/doc-sourcemaps.html
|
||||
examples/doc-sourcemaps2.html
|
||||
examples/doc-sourcemaps3.html
|
||||
|
@ -116,8 +118,10 @@ support-files =
|
|||
examples/long.js
|
||||
examples/math.min.js
|
||||
examples/nested/nested-source.js
|
||||
examples/top-level.js
|
||||
examples/opts.js
|
||||
examples/output.js
|
||||
examples/preview.js
|
||||
examples/simple1.js
|
||||
examples/simple2.js
|
||||
examples/simple3.js
|
||||
|
@ -174,6 +178,8 @@ skip-if = os == "win"
|
|||
[browser_dbg-pretty-print-paused.js]
|
||||
[browser_dbg-preview.js]
|
||||
skip-if = os == "win"
|
||||
[browser_dbg-preview-module.js]
|
||||
skip-if = os == "win"
|
||||
[browser_dbg-preview-source-maps.js]
|
||||
skip-if = os == "win"
|
||||
[browser_dbg-returnvalues.js]
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
function toggleBreakpoint(dbg, index) {
|
||||
const bp = findElement(dbg, "breakpointItem", index);
|
||||
const bp = findAllElements(dbg, "breakpointItems")[index];
|
||||
const input = bp.querySelector("input");
|
||||
input.click();
|
||||
}
|
||||
|
||||
async function removeBreakpoint(dbg, index) {
|
||||
const removed = waitForDispatch(dbg, "REMOVE_BREAKPOINT");
|
||||
const bp = findElement(dbg, "breakpointItem", index);
|
||||
const bp = findAllElements(dbg, "breakpointItems")[index];
|
||||
bp.querySelector(".close-btn").click();
|
||||
await removed;
|
||||
}
|
||||
|
@ -80,8 +80,8 @@ add_task(async function() {
|
|||
is(bp2.disabled, false, "second breakpoint is enabled");
|
||||
|
||||
// Remove the breakpoints
|
||||
await removeBreakpoint(dbg, 1);
|
||||
await removeBreakpoint(dbg, 1);
|
||||
await removeBreakpoint(dbg, 0);
|
||||
await removeBreakpoint(dbg, 0);
|
||||
|
||||
const bps = findBreakpoints(dbg);
|
||||
|
||||
|
|
|
@ -2,18 +2,11 @@
|
|||
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
function toggleBreakpoint(dbg, index) {
|
||||
const bp = findElement(dbg, "breakpointItem", index);
|
||||
const bp = findAllElements(dbg, "breakpointItems")[index];
|
||||
const input = bp.querySelector("input");
|
||||
input.click();
|
||||
}
|
||||
|
||||
async function removeBreakpoint(dbg, index) {
|
||||
const removed = waitForDispatch(dbg, "REMOVE_BREAKPOINT");
|
||||
const bp = findElement(dbg, "breakpointItem", index);
|
||||
bp.querySelector(".close-btn").click();
|
||||
await removed;
|
||||
}
|
||||
|
||||
async function disableBreakpoint(dbg, index) {
|
||||
const disabled = waitForDispatch(dbg, "DISABLE_BREAKPOINT");
|
||||
toggleBreakpoint(dbg, index);
|
||||
|
@ -62,15 +55,15 @@ add_task(async function() {
|
|||
await addBreakpoint(dbg, "simple2", 5);
|
||||
|
||||
// Disable the first one
|
||||
await disableBreakpoint(dbg, 1);
|
||||
await disableBreakpoint(dbg, 0);
|
||||
let bp1 = findBreakpoint(dbg, "simple2", 3);
|
||||
let bp2 = findBreakpoint(dbg, "simple2", 5);
|
||||
is(bp1.disabled, true, "first breakpoint is disabled");
|
||||
is(bp2.disabled, false, "second breakpoint is enabled");
|
||||
|
||||
// Disable and Re-Enable the second one
|
||||
await disableBreakpoint(dbg, 2);
|
||||
await enableBreakpoint(dbg, 2);
|
||||
await disableBreakpoint(dbg, 1);
|
||||
await enableBreakpoint(dbg, 1);
|
||||
bp2 = findBreakpoint(dbg, "simple2", 5);
|
||||
is(bp2.disabled, false, "second breakpoint is enabled");
|
||||
});
|
||||
|
|
|
@ -14,7 +14,7 @@ const {
|
|||
} = require("devtools/client/framework/devtools-browser");
|
||||
|
||||
function toggleBreakpoint(dbg, index) {
|
||||
const bp = findElement(dbg, "breakpointItem", index);
|
||||
const bp = findAllElements(dbg, "breakpointItems")[index];
|
||||
const input = bp.querySelector("input");
|
||||
input.click();
|
||||
}
|
||||
|
@ -57,12 +57,12 @@ add_task(async function() {
|
|||
await addBreakpoint(dbg, "simple2", 3);
|
||||
|
||||
info("Disable the breakpoint");
|
||||
await disableBreakpoint(dbg, 1);
|
||||
await disableBreakpoint(dbg, 0);
|
||||
let bp = findBreakpoint(dbg, "simple2", 3);
|
||||
is(bp.disabled, true, "breakpoint is disabled");
|
||||
|
||||
info("Enable the breakpoint");
|
||||
await enableBreakpoint(dbg, 1);
|
||||
await enableBreakpoint(dbg, 0);
|
||||
bp = findBreakpoint(dbg, "simple2", 3);
|
||||
is(bp.disabled, false, "breakpoint is enabled");
|
||||
|
||||
|
|
|
@ -29,17 +29,6 @@ async function addExpression(dbg, input) {
|
|||
await evaluation;
|
||||
}
|
||||
|
||||
async function editExpression(dbg, input) {
|
||||
info("updating the expression");
|
||||
dblClickElement(dbg, "expressionNode", 1);
|
||||
// Position cursor reliably at the end of the text.
|
||||
const evaluation = waitForDispatch(dbg, "EVALUATE_EXPRESSION");
|
||||
pressKey(dbg, "End");
|
||||
type(dbg, input);
|
||||
pressKey(dbg, "Enter");
|
||||
await evaluation;
|
||||
}
|
||||
|
||||
add_task(async function() {
|
||||
const dbg = await initDebugger("doc-script-switching.html");
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ function hoverAtPos(dbg, { line, ch }) {
|
|||
return previewed;
|
||||
}
|
||||
|
||||
function assertTooltip(dbg, { result, expression }) {
|
||||
function assertPreviewTooltip(dbg, { result, expression }) {
|
||||
const previewEl = findElement(dbg, "tooltip");
|
||||
is(previewEl.innerText, result, "Preview text shown to user");
|
||||
|
||||
|
@ -31,7 +31,7 @@ function assertTooltip(dbg, { result, expression }) {
|
|||
is(preview.expression, expression, "Preview.expression");
|
||||
}
|
||||
|
||||
function assertPopup(dbg, { field, value, expression }) {
|
||||
function assertPreviewPopup(dbg, { field, value, expression }) {
|
||||
const previewEl = findElement(dbg, "popup");
|
||||
is(previewEl.innerText, "", "Preview text shown to user");
|
||||
|
||||
|
|
|
@ -1,74 +1,38 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
function getCoordsFromPosition(cm, { line, ch }) {
|
||||
return cm.charCoords({ line: ~~line, ch: ~~ch });
|
||||
}
|
||||
|
||||
function hoverAtPos(dbg, { line, ch }) {
|
||||
const cm = getCM(dbg);
|
||||
const coords = getCoordsFromPosition(cm, { line: line - 1, ch });
|
||||
const tokenEl = dbg.win.document.elementFromPoint(coords.left, coords.top);
|
||||
tokenEl.dispatchEvent(
|
||||
new MouseEvent("mouseover", {
|
||||
bubbles: true,
|
||||
cancelable: true,
|
||||
view: dbg.win
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
async function assertTooltip(dbg, { result, expression }) {
|
||||
const previewEl = await waitForElement(dbg, "tooltip");
|
||||
is(previewEl.innerText, result, "Preview text shown to user");
|
||||
|
||||
const preview = dbg.selectors.getPreview(dbg.getState());
|
||||
is(`${preview.result}`, result, "Preview.result");
|
||||
is(preview.updating, false, "Preview.updating");
|
||||
is(preview.expression, expression, "Preview.expression");
|
||||
}
|
||||
|
||||
async function assertPreviewPopup(dbg, { field, value, expression }) {
|
||||
const previewEl = await waitForElement(dbg, "popup");
|
||||
const preview = dbg.selectors.getPreview(dbg.getState());
|
||||
|
||||
is(
|
||||
`${preview.result.preview.ownProperties[field].value}`,
|
||||
value,
|
||||
"Preview.result"
|
||||
);
|
||||
is(preview.updating, false, "Preview.updating");
|
||||
is(preview.expression, expression, "Preview.expression");
|
||||
}
|
||||
|
||||
add_task(async function() {
|
||||
const dbg = await initDebugger("doc-scripts.html");
|
||||
const { selectors: { getSelectedSource }, getState } = dbg;
|
||||
const simple3 = findSource(dbg, "simple3.js");
|
||||
|
||||
await selectSource(dbg, "simple3");
|
||||
|
||||
await addBreakpoint(dbg, simple3, 5);
|
||||
|
||||
invokeInTab("simple");
|
||||
async function previews(dbg, fnName, previews) {
|
||||
const invokeResult = invokeInTab(fnName);
|
||||
await waitForPaused(dbg);
|
||||
|
||||
const tooltipPreviewed = waitForDispatch(dbg, "SET_PREVIEW");
|
||||
hoverAtPos(dbg, { line: 5, ch: 12 });
|
||||
await tooltipPreviewed;
|
||||
await assertTooltip(dbg, { result: "3", expression: "result" });
|
||||
await assertPreviews(dbg, previews);
|
||||
await resume(dbg);
|
||||
|
||||
const popupPreviewed = waitForDispatch(dbg, "SET_PREVIEW");
|
||||
hoverAtPos(dbg, { line: 2, ch: 10 });
|
||||
await popupPreviewed;
|
||||
await assertPreviewPopup(dbg, {
|
||||
field: "foo",
|
||||
value: "1",
|
||||
expression: "obj"
|
||||
});
|
||||
await assertPreviewPopup(dbg, {
|
||||
field: "bar",
|
||||
value: "2",
|
||||
expression: "obj"
|
||||
});
|
||||
info(`Ran tests for ${fnName}`);
|
||||
}
|
||||
|
||||
// Test hovering on an object, which will show a popup and on a
|
||||
// simple value, which will show a tooltip.
|
||||
add_task(async function() {
|
||||
const dbg = await initDebugger("doc-preview.html");
|
||||
await selectSource(dbg, "preview.js");
|
||||
|
||||
await previews(dbg, "empties", [
|
||||
// { line: 2, column: 9, expression: "a", result: '""' },
|
||||
// { line: 3, column: 9, expression: "b", result: "false" },
|
||||
{ line: 4, column: 9, expression: "c", result: "undefined" },
|
||||
{ line: 5, column: 9, expression: "d", result: "null" }
|
||||
]);
|
||||
|
||||
await previews(dbg, "smalls", [
|
||||
{ line: 10, column: 9, expression: "a", result: '"..."' },
|
||||
{ line: 11, column: 9, expression: "b", result: "true" },
|
||||
{ line: 12, column: 9, expression: "c", result: "1" },
|
||||
{
|
||||
line: 13,
|
||||
column: 9,
|
||||
expression: "d",
|
||||
fields: [["length", "0"]]
|
||||
}
|
||||
]);
|
||||
});
|
||||
|
|
|
@ -19,6 +19,7 @@ async function waitForBreakpoint(dbg, location) {
|
|||
|
||||
add_task(async function() {
|
||||
const dbg = await initDebugger("reload/doc-reload.html");
|
||||
|
||||
await waitForSource(dbg, "sjs_code_reload");
|
||||
await selectSource(dbg, "sjs_code_reload");
|
||||
await addBreakpoint(dbg, "sjs_code_reload", 2);
|
||||
|
|
|
@ -16,5 +16,8 @@
|
|||
// it's not immediately garbage collected.
|
||||
inline_script = function () { var x = 5; };
|
||||
</script>
|
||||
|
||||
<button onclick="empties()">Empties</button>
|
||||
<button onclick="smalls()">Smalls</button>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -177,7 +177,7 @@ function waitForState(dbg, predicate, msg) {
|
|||
}
|
||||
|
||||
const unsubscribe = dbg.store.subscribe(() => {
|
||||
const result = predicate(dbg.store.getState())
|
||||
const result = predicate(dbg.store.getState());
|
||||
if (result) {
|
||||
info(`Finished waiting for state change: ${msg || ""}`);
|
||||
unsubscribe();
|
||||
|
@ -228,10 +228,14 @@ async function waitForSources(dbg, ...sources) {
|
|||
* @static
|
||||
*/
|
||||
function waitForSource(dbg, url) {
|
||||
return waitForState(dbg, state => {
|
||||
const sources = dbg.selectors.getSources(state);
|
||||
return sources.find(s => (s.get("url") || "").includes(url));
|
||||
}, `source exists`);
|
||||
return waitForState(
|
||||
dbg,
|
||||
state => {
|
||||
const sources = dbg.selectors.getSources(state);
|
||||
return sources.find(s => (s.get("url") || "").includes(url));
|
||||
},
|
||||
`source exists`
|
||||
);
|
||||
}
|
||||
|
||||
async function waitForElement(dbg, name) {
|
||||
|
@ -265,7 +269,10 @@ function waitForSelectedSource(dbg, url) {
|
|||
|
||||
// wait for async work to be done
|
||||
const hasSymbols = dbg.selectors.hasSymbols(state, source);
|
||||
const hasSourceMetaData = dbg.selectors.hasSourceMetaData(state, source.id);
|
||||
const hasSourceMetaData = dbg.selectors.hasSourceMetaData(
|
||||
state,
|
||||
source.id
|
||||
);
|
||||
const hasPausePoints = dbg.selectors.hasPausePoints(state, source.id);
|
||||
return hasSymbols && hasSourceMetaData && hasPausePoints;
|
||||
},
|
||||
|
@ -689,8 +696,8 @@ function deleteExpression(dbg, input) {
|
|||
* @static
|
||||
*/
|
||||
async function reload(dbg, ...sources) {
|
||||
const navigated = waitForDispatch(dbg, "NAVIGATE")
|
||||
await dbg.client.reload()
|
||||
const navigated = waitForDispatch(dbg, "NAVIGATE");
|
||||
await dbg.client.reload();
|
||||
await navigated;
|
||||
return waitForSources(dbg, ...sources);
|
||||
}
|
||||
|
@ -936,7 +943,8 @@ const selectors = {
|
|||
`.expressions-list .expression-container:nth-child(${i}) .close`,
|
||||
expressionNodes: ".expressions-list .tree-node",
|
||||
scopesHeader: ".scopes-pane ._header",
|
||||
breakpointItem: i => `.breakpoints-list .breakpoint:nth-child(${i})`,
|
||||
breakpointItem: i => `.breakpoints-list .breakpoint:nth-of-type(${i})`,
|
||||
breakpointItems: `.breakpoints-list .breakpoint`,
|
||||
scopes: ".scopes-list",
|
||||
scopeNode: i => `.scopes-list .tree-node:nth-child(${i}) .object-label`,
|
||||
scopeValue: i =>
|
||||
|
@ -1113,12 +1121,13 @@ function getCoordsFromPosition(cm, { line, ch }) {
|
|||
}
|
||||
|
||||
function hoverAtPos(dbg, { line, ch }) {
|
||||
info(`Hovering at ${line}, ${ch}`);
|
||||
const cm = getCM(dbg);
|
||||
|
||||
// Ensure the line is visible with margin because the bar at the bottom of
|
||||
// the editor overlaps into what the editor things is its own space, blocking
|
||||
// the click event below.
|
||||
cm.scrollIntoView({ line: line - 1, ch }, 100);
|
||||
cm.scrollIntoView({ line: line - 1, ch }, 100);
|
||||
|
||||
const coords = getCoordsFromPosition(cm, { line: line - 1, ch });
|
||||
const tokenEl = dbg.win.document.elementFromPoint(coords.left, coords.top);
|
||||
|
@ -1132,7 +1141,7 @@ function hoverAtPos(dbg, { line, ch }) {
|
|||
}
|
||||
|
||||
async function assertPreviewTextValue(dbg, { text, expression }) {
|
||||
const previewEl = await waitForElement(dbg, "previewPopup");;
|
||||
const previewEl = await waitForElement(dbg, "previewPopup");
|
||||
|
||||
is(previewEl.innerText, text, "Preview text shown to user");
|
||||
|
||||
|
@ -1155,15 +1164,37 @@ async function assertPreviewPopup(dbg, { field, value, expression }) {
|
|||
const previewEl = await waitForElement(dbg, "popup");
|
||||
const preview = dbg.selectors.getPreview(dbg.getState());
|
||||
|
||||
is(
|
||||
`${preview.result.preview.ownProperties[field].value}`,
|
||||
value,
|
||||
"Preview.result"
|
||||
);
|
||||
const properties =
|
||||
preview.result.preview.ownProperties || preview.result.preview.items;
|
||||
const property = properties[field];
|
||||
|
||||
is(`${property.value || property}`, value, "Preview.result");
|
||||
is(preview.updating, false, "Preview.updating");
|
||||
is(preview.expression, expression, "Preview.expression");
|
||||
}
|
||||
|
||||
async function assertPreviews(dbg, previews) {
|
||||
for (const { line, column, expression, result, fields } of previews) {
|
||||
hoverAtPos(dbg, { line, ch: column - 1 });
|
||||
|
||||
if (fields && result) {
|
||||
throw new Error("Invalid test fixture");
|
||||
}
|
||||
|
||||
if (fields) {
|
||||
for (const [field, value] of fields) {
|
||||
await assertPreviewPopup(dbg, { expression, field, value });
|
||||
}
|
||||
} else {
|
||||
await assertPreviewTextValue(dbg, { expression, text: result });
|
||||
}
|
||||
|
||||
// Move to column 0 after to make sure that the preview created by this
|
||||
// test does not affect later attempts to hover and preview.
|
||||
hoverAtPos(dbg, { line: line, ch: 0 });
|
||||
}
|
||||
}
|
||||
|
||||
// NOTE: still experimental, the screenshots might not be exactly correct
|
||||
async function takeScreenshot(dbg) {
|
||||
let canvas = dbg.win.document.createElementNS(
|
||||
|
|
|
@ -51,7 +51,7 @@ pref("devtools.debugger.features.shortcuts", true);
|
|||
pref("devtools.debugger.features.root", true);
|
||||
pref("devtools.debugger.features.column-breakpoints", false);
|
||||
pref("devtools.debugger.features.chrome-scopes", false);
|
||||
pref("devtools.debugger.features.map-scopes", false);
|
||||
pref("devtools.debugger.features.map-scopes", true);
|
||||
pref("devtools.debugger.features.breakpoints-dropdown", false);
|
||||
pref("devtools.debugger.features.remove-command-bar-options", false);
|
||||
pref("devtools.debugger.features.workers", true);
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
const Services = require("Services");
|
||||
const { closeToolboxAndLog, garbageCollect, runTest, testSetup,
|
||||
testTeardown, PAGES_BASE_URL } = require("../head");
|
||||
const { createContext, openDebuggerAndLog, pauseDebugger, reloadDebuggerAndLog,
|
||||
|
@ -19,6 +20,7 @@ const EXPECTED_FUNCTION = "window.hitBreakpoint()";
|
|||
|
||||
module.exports = async function() {
|
||||
const tab = await testSetup(PAGES_BASE_URL + "custom/debugger/index.html");
|
||||
Services.prefs.setBoolPref("devtools.debugger.features.map-scopes", false);
|
||||
|
||||
const toolbox = await openDebuggerAndLog("custom", EXPECTED);
|
||||
await reloadDebuggerAndLog("custom", toolbox, EXPECTED);
|
||||
|
@ -29,6 +31,7 @@ module.exports = async function() {
|
|||
|
||||
await closeToolboxAndLog("custom.jsdebugger", toolbox);
|
||||
|
||||
Services.prefs.clearUserPref("devtools.debugger.features.map-scopes");
|
||||
await testTeardown();
|
||||
};
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче