зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1472023 - Update Debugger Frontend v66. r=dwalsh
MozReview-Commit-ID: 8FV5f3SVjUO
This commit is contained in:
Родитель
ae6820174e
Коммит
db19c052dd
|
@ -1,9 +1,9 @@
|
|||
This is the debugger.html project output.
|
||||
See https://github.com/devtools-html/debugger.html
|
||||
|
||||
Version 64
|
||||
Version 66
|
||||
|
||||
Comparison: https://github.com/devtools-html/debugger.html/compare/release-63...release-64
|
||||
Comparison: https://github.com/devtools-html/debugger.html/compare/release-65...release-66
|
||||
|
||||
Packages:
|
||||
- babel-plugin-transform-es2015-modules-commonjs @6.26.2
|
||||
|
|
|
@ -1673,7 +1673,8 @@ function extractSymbols(sourceId) {
|
|||
imports: [],
|
||||
literals: [],
|
||||
hasJsx: false,
|
||||
hasTypes: false
|
||||
hasTypes: false,
|
||||
loading: false
|
||||
};
|
||||
|
||||
const ast = (0, _ast.traverseAst)(sourceId, {
|
||||
|
|
|
@ -7890,15 +7890,6 @@ class Tree extends Component {
|
|||
return;
|
||||
}
|
||||
|
||||
const traversal = this._dfsFromRoots();
|
||||
const length = traversal.length;
|
||||
let parentIndex = 0;
|
||||
for (; parentIndex < length; parentIndex++) {
|
||||
if (traversal[parentIndex].item === parent) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
this._focus(parent, { alignTo: "top" });
|
||||
}
|
||||
|
||||
|
@ -7979,12 +7970,12 @@ class Tree extends Component {
|
|||
return;
|
||||
}
|
||||
|
||||
const { relatedTarget } = nativeEvent;
|
||||
const { explicitOriginalTarget } = nativeEvent;
|
||||
|
||||
// Only set default focus to the first tree node if the focus came
|
||||
// from outside the tree (e.g. by tabbing to the tree from other
|
||||
// external elements).
|
||||
if (relatedTarget !== this.treeRef && !this.treeRef.contains(relatedTarget)) {
|
||||
if (explicitOriginalTarget !== this.treeRef && !this.treeRef.contains(explicitOriginalTarget)) {
|
||||
this._focus(traversal[0].item);
|
||||
}
|
||||
},
|
||||
|
|
|
@ -407,12 +407,13 @@ function toggleBreakpoint(line, column) {
|
|||
client,
|
||||
sourceMaps
|
||||
}) => {
|
||||
if (!line) {
|
||||
const state = getState();
|
||||
const selectedSource = (0, _selectors.getSelectedSource)(state);
|
||||
|
||||
if (!line || !selectedSource) {
|
||||
return;
|
||||
}
|
||||
|
||||
const state = getState();
|
||||
const selectedSource = (0, _selectors.getSelectedSource)(state);
|
||||
const bp = (0, _selectors.getBreakpointAtLocation)(state, {
|
||||
line,
|
||||
column
|
||||
|
@ -449,11 +450,12 @@ function addOrToggleDisabledBreakpoint(line, column) {
|
|||
client,
|
||||
sourceMaps
|
||||
}) => {
|
||||
if (!line) {
|
||||
const selectedSource = (0, _selectors.getSelectedSource)(getState());
|
||||
|
||||
if (!line || !selectedSource) {
|
||||
return;
|
||||
}
|
||||
|
||||
const selectedSource = (0, _selectors.getSelectedSource)(getState());
|
||||
const bp = (0, _selectors.getBreakpointAtLocation)(getState(), {
|
||||
line,
|
||||
column
|
||||
|
@ -469,8 +471,8 @@ function addOrToggleDisabledBreakpoint(line, column) {
|
|||
}
|
||||
|
||||
return dispatch(addBreakpoint({
|
||||
sourceId: selectedSource.get("id"),
|
||||
sourceUrl: selectedSource.get("url"),
|
||||
sourceId: selectedSource.id,
|
||||
sourceUrl: selectedSource.url,
|
||||
line: line,
|
||||
column: column
|
||||
}));
|
||||
|
|
|
@ -20,12 +20,12 @@ function continueToHere(line) {
|
|||
getState
|
||||
}) {
|
||||
const selectedSource = (0, _selectors.getSelectedSource)(getState());
|
||||
const selectedFrame = (0, _selectors.getSelectedFrame)(getState());
|
||||
|
||||
if (!(0, _selectors.isPaused)(getState()) || !selectedSource) {
|
||||
if (!selectedFrame || !selectedSource) {
|
||||
return;
|
||||
}
|
||||
|
||||
const selectedFrame = (0, _selectors.getSelectedFrame)(getState());
|
||||
const debugLine = selectedFrame.location.line;
|
||||
|
||||
if (debugLine == line) {
|
||||
|
|
|
@ -73,6 +73,11 @@ function fetchExtra() {
|
|||
getState
|
||||
}) {
|
||||
const frame = (0, _selectors.getSelectedFrame)(getState());
|
||||
|
||||
if (!frame) {
|
||||
return;
|
||||
}
|
||||
|
||||
const extra = await dispatch(getExtra("this;", frame.this));
|
||||
dispatch({
|
||||
type: "ADD_EXTRA",
|
||||
|
|
|
@ -88,7 +88,7 @@ function paused(pauseInfo) {
|
|||
|
||||
if (selectedFrame) {
|
||||
const visibleFrame = (0, _selectors.getVisibleSelectedFrame)(getState());
|
||||
const location = (0, _devtoolsSourceMap.isGeneratedId)(visibleFrame.location.sourceId) ? selectedFrame.generatedLocation : selectedFrame.location;
|
||||
const location = visibleFrame && (0, _devtoolsSourceMap.isGeneratedId)(visibleFrame.location.sourceId) ? selectedFrame.generatedLocation : selectedFrame.location;
|
||||
await dispatch((0, _sources.selectLocation)(location));
|
||||
}
|
||||
|
||||
|
|
|
@ -83,6 +83,11 @@ function setPreview(expression, location, tokenPos, cursorPos) {
|
|||
type: "SET_PREVIEW",
|
||||
[_promise.PROMISE]: async function () {
|
||||
const source = (0, _selectors.getSelectedSource)(getState());
|
||||
|
||||
if (!source) {
|
||||
return;
|
||||
}
|
||||
|
||||
const sourceId = source.id;
|
||||
const selectedFrame = (0, _selectors.getSelectedFrame)(getState());
|
||||
|
||||
|
|
|
@ -248,6 +248,11 @@ function jumpToMappedSelectedLocation() {
|
|||
getState
|
||||
}) {
|
||||
const location = (0, _selectors.getSelectedLocation)(getState());
|
||||
|
||||
if (!location) {
|
||||
return;
|
||||
}
|
||||
|
||||
await dispatch(jumpToMappedLocation(location));
|
||||
};
|
||||
}
|
|
@ -336,4 +336,4 @@ const mapDispatchToProps = {
|
|||
setPopupObjectProperties,
|
||||
openLink
|
||||
};
|
||||
exports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(Popup);
|
||||
exports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(Popup);
|
||||
|
|
|
@ -324,23 +324,6 @@ class QuickOpenModal extends _react.Component {
|
|||
|
||||
this.isSourceSearch = () => this.isSourcesQuery() || this.isGotoSourceQuery();
|
||||
|
||||
this.renderHighlight = (candidateString, query, name) => {
|
||||
const options = {
|
||||
wrap: {
|
||||
tagOpen: '<mark class="highlight">',
|
||||
tagClose: "</mark>"
|
||||
}
|
||||
};
|
||||
|
||||
const html = _fuzzaldrinPlus2.default.wrap(candidateString, query, options);
|
||||
|
||||
return _react2.default.createElement("div", {
|
||||
dangerouslySetInnerHTML: {
|
||||
__html: html
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
this.highlightMatching = (query, results) => {
|
||||
let newQuery = query;
|
||||
|
||||
|
@ -350,9 +333,13 @@ class QuickOpenModal extends _react.Component {
|
|||
|
||||
newQuery = query.replace(/[@:#?]/gi, " ");
|
||||
return results.map(result => {
|
||||
return _objectSpread({}, result, {
|
||||
title: this.renderHighlight(result.title, (0, _path.basename)(newQuery), "title")
|
||||
});
|
||||
if (typeof result.title == "string") {
|
||||
return _objectSpread({}, result, {
|
||||
title: this.renderHighlight(result.title, (0, _path.basename)(newQuery), "title")
|
||||
});
|
||||
}
|
||||
|
||||
return result;
|
||||
});
|
||||
};
|
||||
|
||||
|
@ -388,6 +375,24 @@ class QuickOpenModal extends _react.Component {
|
|||
}
|
||||
}
|
||||
|
||||
/* eslint-disable react/no-danger */
|
||||
renderHighlight(candidateString, query, name) {
|
||||
const options = {
|
||||
wrap: {
|
||||
tagOpen: '<mark class="highlight">',
|
||||
tagClose: "</mark>"
|
||||
}
|
||||
};
|
||||
|
||||
const html = _fuzzaldrinPlus2.default.wrap(candidateString, query, options);
|
||||
|
||||
return _react2.default.createElement("div", {
|
||||
dangerouslySetInnerHTML: {
|
||||
__html: html
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
shouldShowErrorEmoji() {
|
||||
const {
|
||||
query
|
||||
|
|
|
@ -77,7 +77,7 @@ class Breakpoints extends _react.Component {
|
|||
breakpoints
|
||||
}) => [_react2.default.createElement("div", {
|
||||
className: "breakpoint-heading",
|
||||
title: source.url,
|
||||
title: (0, _source.getRawSourceURL)(source.url),
|
||||
key: source.url,
|
||||
onClick: () => this.props.selectSource(source.id)
|
||||
}, _react2.default.createElement(_SourceIcon2.default, {
|
||||
|
|
|
@ -80,7 +80,7 @@ class FrameComponent extends _react.Component {
|
|||
}
|
||||
|
||||
onMouseDown(e, frame, selectedFrame) {
|
||||
if (e.nativeEvent.which == 3) {
|
||||
if (e.which == 3) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -171,11 +171,12 @@ class Popover extends _react.Component {
|
|||
const editorRect = editor.getBoundingClientRect();
|
||||
const targetRect = this.props.targetPosition;
|
||||
const left = this.calculateLeft(targetRect, editorRect, tooltipRect);
|
||||
const top = targetRect.top - tooltipRect.height;
|
||||
const enoughRoomForTooltipAbove = targetRect.top - editorRect.top > tooltipRect.height;
|
||||
const top = enoughRoomForTooltipAbove ? targetRect.top - tooltipRect.height : targetRect.bottom;
|
||||
return {
|
||||
left,
|
||||
top,
|
||||
orientation: "up",
|
||||
orientation: enoughRoomForTooltipAbove ? "up" : "down",
|
||||
targetMid: {
|
||||
x: 0,
|
||||
y: 0
|
||||
|
|
|
@ -41,7 +41,8 @@ class PreviewFunction extends _react.Component {
|
|||
const commas = (0, _lodash.times)(params.length - 1).map((_, i) => _react2.default.createElement("span", {
|
||||
className: "delimiter",
|
||||
key: i
|
||||
}, ", "));
|
||||
}, ", ")); // $FlowIgnore
|
||||
|
||||
return (0, _lodash.flatten)((0, _lodash.zip)(params, commas));
|
||||
}
|
||||
|
||||
|
|
|
@ -108,7 +108,7 @@ class SearchInput extends _react.Component {
|
|||
handleNext,
|
||||
handlePrev
|
||||
} = this.props;
|
||||
return [arrowBtn(handleNext, "arrow-down", (0, _classnames2.default)("nav-btn", "next"), L10N.getFormatStr("editor.searchResults.nextResult")), arrowBtn(handlePrev, "arrow-up", (0, _classnames2.default)("nav-btn", "prev"), L10N.getFormatStr("editor.searchResults.prevResult"))];
|
||||
return [arrowBtn(handlePrev, "arrow-up", (0, _classnames2.default)("nav-btn", "prev"), L10N.getFormatStr("editor.searchResults.prevResult")), arrowBtn(handleNext, "arrow-down", (0, _classnames2.default)("nav-btn", "next"), L10N.getFormatStr("editor.searchResults.nextResult"))];
|
||||
}
|
||||
|
||||
renderSummaryMsg() {
|
||||
|
|
|
@ -154,7 +154,7 @@ function hasSymbols(state, source) {
|
|||
return false;
|
||||
}
|
||||
|
||||
return !symbols.hasOwnProperty("loading");
|
||||
return !symbols.loading;
|
||||
}
|
||||
|
||||
function isSymbolsLoading(state, source) {
|
||||
|
@ -164,7 +164,7 @@ function isSymbolsLoading(state, source) {
|
|||
return false;
|
||||
}
|
||||
|
||||
return symbols.hasOwnProperty("loading");
|
||||
return symbols.loading;
|
||||
}
|
||||
|
||||
function isEmptyLineInSource(state, line, selectedSourceId) {
|
||||
|
|
|
@ -7,8 +7,6 @@ exports.getWorkers = exports.createDebuggeeState = undefined;
|
|||
exports.default = debuggee;
|
||||
exports.getWorker = getWorker;
|
||||
|
||||
var _reselect = require("devtools/client/debugger/new/dist/vendors").vendored["reselect"];
|
||||
|
||||
var _immutable = require("devtools/client/shared/vendor/immutable");
|
||||
|
||||
var _makeRecord = require("../utils/makeRecord");
|
||||
|
@ -39,9 +37,7 @@ function debuggee(state = createDebuggeeState(), action) {
|
|||
}
|
||||
}
|
||||
|
||||
const getDebuggeeWrapper = state => state.debuggee;
|
||||
|
||||
const getWorkers = exports.getWorkers = (0, _reselect.createSelector)(getDebuggeeWrapper, debuggeeState => debuggeeState.get("workers"));
|
||||
const getWorkers = exports.getWorkers = state => state.debuggee.workers;
|
||||
|
||||
function getWorker(state, url) {
|
||||
return getWorkers(state).find(value => url);
|
||||
|
|
|
@ -74,8 +74,7 @@ function update(state = initialState(), action) {
|
|||
function addScopes(state, action) {
|
||||
const {
|
||||
frame,
|
||||
status,
|
||||
value
|
||||
status
|
||||
} = action;
|
||||
const selectedFrameId = frame.id;
|
||||
const instance = state.history[state.position];
|
||||
|
@ -85,12 +84,16 @@ function addScopes(state, action) {
|
|||
}
|
||||
|
||||
const pausedInst = instance.paused;
|
||||
const scopeValue = status === "done" ? {
|
||||
pending: false,
|
||||
scope: action.value
|
||||
} : {
|
||||
pending: true,
|
||||
scope: null
|
||||
};
|
||||
|
||||
const generated = _objectSpread({}, pausedInst.frameScopes.generated, {
|
||||
[selectedFrameId]: {
|
||||
pending: status !== "done",
|
||||
scope: value
|
||||
}
|
||||
[selectedFrameId]: scopeValue
|
||||
});
|
||||
|
||||
const newPaused = _objectSpread({}, pausedInst, {
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.getSelectedSourceText = exports.getSelectedSource = exports.getSelectedLocation = exports.getSourcesForTabs = exports.getSourceTabs = exports.getTabs = exports.getSources = exports.RelativeSourceRecordClass = exports.SourceRecordClass = undefined;
|
||||
exports.getSelectedSource = exports.getSelectedLocation = exports.getSourcesForTabs = exports.getSourceTabs = exports.getTabs = exports.getSources = exports.RelativeSourceRecordClass = exports.SourceRecordClass = undefined;
|
||||
exports.initialSourcesState = initialSourcesState;
|
||||
exports.createSourceRecord = createSourceRecord;
|
||||
exports.removeSourceFromTabList = removeSourceFromTabList;
|
||||
|
@ -122,16 +122,12 @@ function update(state = initialSourcesState(), action) {
|
|||
|
||||
case "ADD_TAB":
|
||||
return state.merge({
|
||||
tabs: updateTabList({
|
||||
sources: state
|
||||
}, action.url)
|
||||
tabs: updateTabList(state.tabs, action.url)
|
||||
});
|
||||
|
||||
case "MOVE_TAB":
|
||||
return state.merge({
|
||||
tabs: updateTabList({
|
||||
sources: state
|
||||
}, action.url, action.tabIndex)
|
||||
tabs: updateTabList(state.tabs, action.url, action.tabIndex)
|
||||
});
|
||||
|
||||
case "CLOSE_TAB":
|
||||
|
@ -162,9 +158,7 @@ function update(state = initialSourcesState(), action) {
|
|||
break;
|
||||
|
||||
case "NAVIGATE":
|
||||
const source = getSelectedSource({
|
||||
sources: state
|
||||
});
|
||||
const source = state.selectedLocation && state.sources.get(state.selectedLocation.sourceId);
|
||||
const url = source && source.url;
|
||||
|
||||
if (!url) {
|
||||
|
@ -181,7 +175,6 @@ function update(state = initialSourcesState(), action) {
|
|||
|
||||
function getTextPropsFromAction(action) {
|
||||
const {
|
||||
value,
|
||||
sourceId
|
||||
} = action;
|
||||
|
||||
|
@ -199,9 +192,9 @@ function getTextPropsFromAction(action) {
|
|||
}
|
||||
|
||||
return {
|
||||
text: value.text,
|
||||
text: action.value.text,
|
||||
id: sourceId,
|
||||
contentType: value.contentType,
|
||||
contentType: action.value.contentType,
|
||||
loadedState: "loaded"
|
||||
};
|
||||
} // TODO: Action is coerced to `any` unfortunately because how we type
|
||||
|
@ -240,11 +233,6 @@ function removeSourcesFromTabList(tabs, urls) {
|
|||
|
||||
function restoreTabs() {
|
||||
const prefsTabs = _prefs.prefs.tabs || [];
|
||||
|
||||
if (prefsTabs.length == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
return prefsTabs;
|
||||
}
|
||||
/**
|
||||
|
@ -254,8 +242,7 @@ function restoreTabs() {
|
|||
*/
|
||||
|
||||
|
||||
function updateTabList(state, url, tabIndex) {
|
||||
let tabs = state.sources.tabs;
|
||||
function updateTabList(tabs, url, tabIndex) {
|
||||
const urlIndex = tabs.indexOf(url);
|
||||
const includesUrl = !!tabs.find(tab => tab == url);
|
||||
|
||||
|
@ -396,7 +383,8 @@ function getSourceInSources(sources, id) {
|
|||
return sources.get(id);
|
||||
}
|
||||
|
||||
const getSources = exports.getSources = (0, _reselect.createSelector)(getSourcesState, sources => sources.sources);
|
||||
const getSources = exports.getSources = sources => sources.sources.sources;
|
||||
|
||||
const getTabs = exports.getTabs = (0, _reselect.createSelector)(getSourcesState, sources => sources.tabs);
|
||||
const getSourceTabs = exports.getSourceTabs = (0, _reselect.createSelector)(getTabs, getSources, (tabs, sources) => tabs.filter(tab => getSourceByUrlInSources(sources, tab)));
|
||||
const getSourcesForTabs = exports.getSourcesForTabs = (0, _reselect.createSelector)(getSourceTabs, getSources, (tabs, sources) => {
|
||||
|
@ -410,8 +398,4 @@ const getSelectedSource = exports.getSelectedSource = (0, _reselect.createSelect
|
|||
|
||||
return sources.get(selectedLocation.sourceId);
|
||||
});
|
||||
const getSelectedSourceText = exports.getSelectedSourceText = (0, _reselect.createSelector)(getSelectedSource, getSourcesState, (selectedSource, sources) => {
|
||||
const id = selectedSource.id;
|
||||
return id ? sources.sourcesText.get(id) : null;
|
||||
});
|
||||
exports.default = update;
|
|
@ -17,7 +17,8 @@ var _source = require("../utils/source");
|
|||
* 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 getBreakpointsForSource(source, breakpoints) {
|
||||
return breakpoints.valueSeq().filter(bp => bp.location.sourceId == source.id && !bp.hidden && (bp.text || bp.condition)).sortBy(bp => bp.location.line).toJS();
|
||||
const bpList = breakpoints.valueSeq();
|
||||
return bpList.filter(bp => bp.location.sourceId == source.id && !bp.hidden && (bp.text || bp.condition)).sortBy(bp => bp.location.line).toJS();
|
||||
}
|
||||
|
||||
function findBreakpointSources(sources, breakpoints) {
|
||||
|
|
|
@ -16,6 +16,11 @@ var _ast2 = require("../reducers/ast");
|
|||
* file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
|
||||
function inComponent(state) {
|
||||
const selectedFrame = (0, _.getSelectedFrame)(state);
|
||||
|
||||
if (!selectedFrame) {
|
||||
return;
|
||||
}
|
||||
|
||||
const source = (0, _.getSource)(state, selectedFrame.location.sourceId);
|
||||
const symbols = (0, _.getSymbols)(state, source);
|
||||
|
||||
|
|
|
@ -69,6 +69,7 @@ function getBabelFrameIndexes(frames) {
|
|||
} // Receives an array of start and end index tuples and returns
|
||||
// an array of async call stack index ranges.
|
||||
// e.g. [[1,3], [5,7]] => [[1,2,3], [5,6,7]]
|
||||
// $FlowIgnore
|
||||
|
||||
|
||||
return (0, _lodash.flatMap)((0, _lodash.zip)(startIndexes, endIndexes), ([startIndex, endIndex]) => (0, _lodash.range)(startIndex, endIndex + 1));
|
||||
|
|
|
@ -5,8 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
|||
});
|
||||
exports.getLibraryFromUrl = getLibraryFromUrl;
|
||||
|
||||
var _lodash = require("devtools/client/shared/vendor/lodash");
|
||||
|
||||
var _getFrameUrl = require("./getFrameUrl");
|
||||
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
|
@ -90,6 +88,11 @@ function getLibraryFromUrl(frame) {
|
|||
// @TODO each of these fns calls getFrameUrl, just call it once
|
||||
// (assuming there's not more complex logic to identify a lib)
|
||||
const frameUrl = (0, _getFrameUrl.getFrameUrl)(frame);
|
||||
const match = (0, _lodash.find)(libraryMap, o => frameUrl.match(o.pattern));
|
||||
return match && match.label;
|
||||
const matches = libraryMap.filter(o => frameUrl.match(o.pattern));
|
||||
|
||||
if (matches.length == 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return matches[0].label;
|
||||
}
|
|
@ -282,7 +282,8 @@ function extractSymbols(sourceId) {
|
|||
imports: [],
|
||||
literals: [],
|
||||
hasJsx: false,
|
||||
hasTypes: false
|
||||
hasTypes: false,
|
||||
loading: false
|
||||
};
|
||||
const ast = (0, _ast.traverseAst)(sourceId, {
|
||||
enter(node, ancestors) {
|
||||
|
|
|
@ -41,13 +41,15 @@ function summarize(symbol) {
|
|||
return `${loc} ${expression} ${name}${params} ${klass} ${names} ${values}`.trim(); // eslint-disable-line max-len
|
||||
}
|
||||
|
||||
function formatKey(name, symbols) {
|
||||
if (name == "hasJsx") {
|
||||
return `hasJsx: ${symbols.hasJsx ? "true" : "false"}`;
|
||||
}
|
||||
const bools = ["hasJsx", "hasTypes", "loading"];
|
||||
|
||||
if (name == "hasTypes") {
|
||||
return `hasTypes: ${symbols.hasTypes ? "true" : "false"}`;
|
||||
function formatBool(name, symbols) {
|
||||
return `${name}: ${symbols[name] ? "true" : "false"}`;
|
||||
}
|
||||
|
||||
function formatKey(name, symbols) {
|
||||
if (bools.includes(name)) {
|
||||
return formatBool(name, symbols);
|
||||
}
|
||||
|
||||
return `${name}:\n${symbols[name].map(summarize).join("\n")}`;
|
||||
|
|
|
@ -89,10 +89,9 @@ support-files =
|
|||
examples/sourcemaps-reload/v3.bundle.js.map
|
||||
examples/sourcemaps-reload/doc-sourcemaps-reload.html
|
||||
examples/sourcemaps-reload/sjs_code_reload.sjs
|
||||
examples/wasm-sourcemaps/average.js
|
||||
examples/wasm-sourcemaps/average.wasm
|
||||
examples/wasm-sourcemaps/average.wasm.map
|
||||
examples/wasm-sourcemaps/average.c
|
||||
examples/wasm-sourcemaps/fib.c
|
||||
examples/wasm-sourcemaps/fib.wasm
|
||||
examples/wasm-sourcemaps/fib.wasm.map
|
||||
examples/wasm-sourcemaps/utils.js
|
||||
examples/sum/sum.js
|
||||
examples/sum/sum.min.js
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
requestLongerTimeout(2);
|
||||
|
||||
/**
|
||||
* Test WebAssembly source maps
|
||||
|
@ -18,22 +19,25 @@ add_task(async function() {
|
|||
await waitForLoadedSource(dbg, "doc-wasm-sourcemaps");
|
||||
assertPausedLocation(dbg);
|
||||
|
||||
await waitForSource(dbg, "wasm-sourcemaps/average.c");
|
||||
await addBreakpoint(dbg, "wasm-sourcemaps/average.c", 12);
|
||||
await waitForSource(dbg, "fib.c");
|
||||
|
||||
clickElement(dbg, "resume");
|
||||
ok(true, "Original sources exist");
|
||||
const mainSrc = findSource(dbg, "fib.c");
|
||||
|
||||
await waitForPaused(dbg);
|
||||
await waitForSelectedSource(dbg, "average.c");
|
||||
assertPausedLocation(dbg);
|
||||
await selectSource(dbg, mainSrc);
|
||||
await addBreakpoint(dbg, "fib.c", 10);
|
||||
|
||||
resume(dbg);
|
||||
|
||||
await waitForPaused(dbg, "fib.c");
|
||||
|
||||
const frames = findAllElements(dbg, "frames");
|
||||
const firstFrameTitle = frames[0].querySelector(".title").textContent;
|
||||
is(firstFrameTitle, "(wasmcall)", "It shall be a wasm call");
|
||||
const firstFrameLocation = frames[0].querySelector(".location").textContent;
|
||||
is(
|
||||
firstFrameLocation.includes("average.c"),
|
||||
firstFrameLocation.includes("fib.c"),
|
||||
true,
|
||||
"It shall be to avarage.c source"
|
||||
"It shall be to fib.c source"
|
||||
);
|
||||
});
|
||||
|
|
|
@ -10,44 +10,22 @@
|
|||
<script>
|
||||
|
||||
function test() {
|
||||
// Create memory and populate int32 array with some data.
|
||||
var buf = Module._malloc(16);
|
||||
var arr = new Int32Array(Module['buffer'], buf, 4);
|
||||
arr.set(new Int32Array([1, 2, 3, 4]));
|
||||
|
||||
var average = Module.ccall(
|
||||
'average',
|
||||
'i32',
|
||||
['*', 'u32'],
|
||||
[buf, arr.length]
|
||||
);
|
||||
console.log(average);
|
||||
const result = wasmInstance.exports.fib(5);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
// WebAssembly module is part of the emscripten generated one,
|
||||
// loading emscripten module via script tag.
|
||||
var Module = {
|
||||
wasmBinary: null,
|
||||
postRun: [],
|
||||
};
|
||||
function loadWasm(emscriptenWrapper, wasmUrl, sourceMapUrl) {
|
||||
var wasmInstance = null;
|
||||
function loadWasm(wasmUrl, sourceMapUrl) {
|
||||
return fetch(wasmUrl).then(res => res.arrayBuffer()).then(buffer => {
|
||||
if (!sourceMapUrl) return buffer;
|
||||
return updateSourceMappingURLSection(buffer, sourceMapUrl);
|
||||
}).then(buffer => {
|
||||
return new Promise(resolve => {
|
||||
Module.wasmBinary = buffer;
|
||||
Module.postRun.push(resolve);
|
||||
let script = document.createElement('script');
|
||||
script.src = emscriptenWrapper;
|
||||
document.head.appendChild(script);
|
||||
});
|
||||
}).then(buffer => WebAssembly.instantiate(buffer)).then(({instance}) => {
|
||||
wasmInstance = instance;
|
||||
});
|
||||
}
|
||||
|
||||
loadWasm('wasm-sourcemaps/average.js',
|
||||
'wasm-sourcemaps/average.wasm',
|
||||
new URL('wasm-sourcemaps/average.wasm.map', document.location).href).then(() => {
|
||||
loadWasm('wasm-sourcemaps/fib.wasm',
|
||||
new URL('wasm-sourcemaps/fib.wasm.map', document.location).href).then(() => {
|
||||
debugger;
|
||||
|
||||
test();
|
||||
|
|
|
@ -1,5 +1,11 @@
|
|||
# Building WebAssembly source and source maps
|
||||
|
||||
```
|
||||
emcc average.c -O2 -g4 -o average.js -s WASM=1 -s EXPORTED_FUNCTIONS="['_average','_sum']"
|
||||
# using https://github.com/yurydelendik/wasmception to build wasm
|
||||
$wasminception/dist/bin/clang --target=wasm32-unknown-unknown-wasm \
|
||||
--sysroot $wasminception/bin/clang -nostartfiles -nostdlib \
|
||||
-Wl,-no-entry,--export=fib -g fib.c -o fib.debug.wasm
|
||||
|
||||
# remove dwarf sections and build map file
|
||||
wasm-dwarf fib.debug.wasm -o fib.wasm.map -s -p "`pwd`=wasm-src://" -x -w fib.wasm
|
||||
```
|
||||
|
|
|
@ -1,21 +0,0 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
extern float average(signed* numbers, unsigned length);
|
||||
extern signed sum(signed* numbers, unsigned length);
|
||||
|
||||
signed __attribute__((noinline)) sum(signed* numbers, unsigned length)
|
||||
{
|
||||
signed result;
|
||||
unsigned i;
|
||||
result = 0;
|
||||
for (i = 0; i < length; i++)
|
||||
result += numbers[i];
|
||||
return result;
|
||||
}
|
||||
|
||||
float average(signed* numbers, unsigned length)
|
||||
{
|
||||
float s = (float)sum(numbers, length);
|
||||
return s / length;
|
||||
}
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Двоичный файл не отображается.
|
@ -1 +0,0 @@
|
|||
{"version":3,"sources":["average.c"],"names":[],"mappings":"u7BAWA,iBAEA,MADA,wBADA,eAEA,cAKA,aACA"}
|
|
@ -0,0 +1,15 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
void swap(int* a, int* b) {
|
||||
int t = *a; *a = *b; *b = t;
|
||||
}
|
||||
|
||||
int fib(int n) {
|
||||
int i, t, a = 0, b = 1;
|
||||
for (i = 0; i < n; i++) {
|
||||
a += b;
|
||||
swap(&a, &b);
|
||||
}
|
||||
return b;
|
||||
}
|
Двоичные данные
devtools/client/debugger/new/test/mochitest/examples/wasm-sourcemaps/fib.debug.wasm
Executable file
Двоичные данные
devtools/client/debugger/new/test/mochitest/examples/wasm-sourcemaps/fib.debug.wasm
Executable file
Двоичный файл не отображается.
Двоичные данные
devtools/client/debugger/new/test/mochitest/examples/wasm-sourcemaps/fib.wasm
Normal file
Двоичные данные
devtools/client/debugger/new/test/mochitest/examples/wasm-sourcemaps/fib.wasm
Normal file
Двоичный файл не отображается.
|
@ -0,0 +1 @@
|
|||
{"mappings":"0JAIW,OAAD,OAAJ,OAAc,OAAD,OAAJ,OAAE,OAAW,OAAJ,OAAE,OAC1B,EAAA,+CAGY,OAAO,OACV,OAAK,WAAI,OAAF,eAAd,uCACO,OAAH,qBACF,UAFkB,yBAApB,EAAA,EAIO,OAAP,uBAAA","names":[],"sources":["wasm-src:///fib.c"],"sourcesContent":["/* Any copyright is dedicated to the Public Domain.\n * http://creativecommons.org/publicdomain/zero/1.0/ */\n\nvoid swap(int* a, int* b) {\n int t = *a; *a = *b; *b = t;\n}\n\nint fib(int n) {\n int i, t, a = 0, b = 1;\n for (i = 0; i < n; i++) {\n a += b;\n swap(&a, &b);\n }\n return b;\n}\n"],"version":3}
|
|
@ -1,13 +1,13 @@
|
|||
(function webpackUniversalModuleDefinition(root, factory) {
|
||||
if(typeof exports === 'object' && typeof module === 'object')
|
||||
module.exports = factory(require("devtools/client/shared/vendor/react"), require("devtools/client/shared/vendor/react-redux"), require("devtools/client/shared/vendor/redux"), require("devtools/client/shared/vendor/react-prop-types"), require("devtools/client/shared/vendor/react-dom-factories"));
|
||||
module.exports = factory(require("devtools/client/shared/vendor/react"), require("Services"), require("devtools/client/shared/vendor/react-redux"), require("devtools/client/shared/vendor/redux"), require("devtools/client/shared/vendor/react-prop-types"), require("devtools/client/shared/vendor/react-dom-factories"));
|
||||
else if(typeof define === 'function' && define.amd)
|
||||
define(["devtools/client/shared/vendor/react", "devtools/client/shared/vendor/react-redux", "devtools/client/shared/vendor/redux", "devtools/client/shared/vendor/react-prop-types", "devtools/client/shared/vendor/react-dom-factories"], factory);
|
||||
define(["devtools/client/shared/vendor/react", "Services", "devtools/client/shared/vendor/react-redux", "devtools/client/shared/vendor/redux", "devtools/client/shared/vendor/react-prop-types", "devtools/client/shared/vendor/react-dom-factories"], factory);
|
||||
else {
|
||||
var a = typeof exports === 'object' ? factory(require("devtools/client/shared/vendor/react"), require("devtools/client/shared/vendor/react-redux"), require("devtools/client/shared/vendor/redux"), require("devtools/client/shared/vendor/react-prop-types"), require("devtools/client/shared/vendor/react-dom-factories")) : factory(root["devtools/client/shared/vendor/react"], root["devtools/client/shared/vendor/react-redux"], root["devtools/client/shared/vendor/redux"], root["devtools/client/shared/vendor/react-prop-types"], root["devtools/client/shared/vendor/react-dom-factories"]);
|
||||
var a = typeof exports === 'object' ? factory(require("devtools/client/shared/vendor/react"), require("Services"), require("devtools/client/shared/vendor/react-redux"), require("devtools/client/shared/vendor/redux"), require("devtools/client/shared/vendor/react-prop-types"), require("devtools/client/shared/vendor/react-dom-factories")) : factory(root["devtools/client/shared/vendor/react"], root["Services"], root["devtools/client/shared/vendor/react-redux"], root["devtools/client/shared/vendor/redux"], root["devtools/client/shared/vendor/react-prop-types"], root["devtools/client/shared/vendor/react-dom-factories"]);
|
||||
for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
|
||||
}
|
||||
})(typeof self !== 'undefined' ? self : this, function(__WEBPACK_EXTERNAL_MODULE_0__, __WEBPACK_EXTERNAL_MODULE_3592__, __WEBPACK_EXTERNAL_MODULE_3593__, __WEBPACK_EXTERNAL_MODULE_3642__, __WEBPACK_EXTERNAL_MODULE_3643__) {
|
||||
})(typeof self !== 'undefined' ? self : this, function(__WEBPACK_EXTERNAL_MODULE_0__, __WEBPACK_EXTERNAL_MODULE_22__, __WEBPACK_EXTERNAL_MODULE_3592__, __WEBPACK_EXTERNAL_MODULE_3593__, __WEBPACK_EXTERNAL_MODULE_3642__, __WEBPACK_EXTERNAL_MODULE_3643__) {
|
||||
return /******/ (function(modules) { // webpackBootstrap
|
||||
/******/ // The module cache
|
||||
/******/ var installedModules = {};
|
||||
|
@ -136,6 +136,13 @@ var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
|
|||
}());
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 22:
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
module.exports = __WEBPACK_EXTERNAL_MODULE_22__;
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 3592:
|
||||
|
@ -4356,15 +4363,6 @@ class Tree extends Component {
|
|||
return;
|
||||
}
|
||||
|
||||
const traversal = this._dfsFromRoots();
|
||||
const length = traversal.length;
|
||||
let parentIndex = 0;
|
||||
for (; parentIndex < length; parentIndex++) {
|
||||
if (traversal[parentIndex].item === parent) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
this._focus(parent, { alignTo: "top" });
|
||||
}
|
||||
|
||||
|
@ -6137,6 +6135,10 @@ module.exports = props => {
|
|||
|
||||
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; };
|
||||
|
||||
var _devtoolsServices = __webpack_require__(22);
|
||||
|
||||
var _devtoolsServices2 = _interopRequireDefault(_devtoolsServices);
|
||||
|
||||
var _devtoolsComponents = __webpack_require__(3669);
|
||||
|
||||
var _devtoolsComponents2 = _interopRequireDefault(_devtoolsComponents);
|
||||
|
@ -6152,6 +6154,9 @@ const dom = __webpack_require__(3643);
|
|||
const { connect } = __webpack_require__(3592);
|
||||
const { bindActionCreators } = __webpack_require__(3593);
|
||||
|
||||
const { appinfo } = _devtoolsServices2.default;
|
||||
const isMacOS = appinfo.OS === "Darwin";
|
||||
|
||||
const Tree = createFactory(_devtoolsComponents2.default.Tree);
|
||||
__webpack_require__(3697);
|
||||
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
# wasmparser version
|
||||
|
||||
Current vesion is: 0.6.0
|
||||
Current vesion is: 0.6.1
|
||||
|
||||
# Upgrade process
|
||||
|
||||
1. Pull latest release from npm and extract WasmDis.js and WasmParser.js, e.g.
|
||||
|
||||
```
|
||||
curl https://registry.npmjs.org/wasmparser/-/wasmparser-0.6.0.tgz | tar -x --strip-components 2 package/dist/{WasmDis,WasmParser}.js
|
||||
curl https://registry.npmjs.org/wasmparser/-/wasmparser-0.6.1.tgz | tar -x --strip-components 2 package/dist/{WasmDis,WasmParser}.js
|
||||
```
|
||||
|
||||
2. Remove reference to source maps (last line)
|
||||
|
|
Загрузка…
Ссылка в новой задаче