Bug 1576689 - Support logPoints with multiple arguments, r=jlast.

Differential Revision: https://phabricator.services.mozilla.com/D45116

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Brian Hackett 2019-09-06 23:35:34 +00:00
Родитель 1b00e04863
Коммит 69a17508bf
5 изменённых файлов: 16 добавлений и 17 удалений

Просмотреть файл

@ -16,13 +16,13 @@ add_task(async function() {
await selectSource(dbg, "doc_rr_basic.html");
await addBreakpoint(dbg, "doc_rr_basic.html", 21, undefined, {
logValue: `displayName + " Logpoint Number " + number`,
logValue: `displayName, "Logpoint Number", number`,
});
await addBreakpoint(dbg, "doc_rr_basic.html", 6, undefined, {
logValue: `displayName + "Logpoint Beginning"`,
logValue: `displayName, "Logpoint Beginning"`,
});
await addBreakpoint(dbg, "doc_rr_basic.html", 8, undefined, {
logValue: `displayName + " Logpoint Ending"`,
logValue: `displayName, " Logpoint Ending"`,
});
await waitForMessageCount(hud, "Logpoint", 12);

Просмотреть файл

@ -108,7 +108,7 @@ BreakpointActor.prototype = {
lineNumber,
columnNumber,
executionPoint,
arguments: ["return" in rv ? rv.return : rv.throw],
arguments: rv,
logpointId: options.logGroupId,
};
this.threadActor._parent._consoleActor.onConsoleAPICall(message);

Просмотреть файл

@ -1427,7 +1427,7 @@ async function findLogpointHits(
const hits = await findHits(checkpoint, position);
for (const point of hits) {
if (!condition) {
callback(point, { return: "Loading..." });
callback(point, ["Loading..."]);
}
sendAsyncManifest({
shouldSkip: () => false,

Просмотреть файл

@ -851,7 +851,7 @@ ReplayDebuggerScript.prototype = {
condition,
(point, result, resultData) => {
const pool = new ReplayPool(this._dbg, resultData);
const converted = pool.convertCompletionValue(result);
const converted = result.map(v => pool.convertValue(v));
callback(point, converted);
}
);

Просмотреть файл

@ -981,15 +981,22 @@ const gManifestStartHandlers = {
}
const displayName = formatDisplayName(frame);
const rv = frame.evalWithBindings(text, { displayName });
const rv = frame.evalWithBindings(`[${text}]`, { displayName });
const pauseData = getPauseData();
pauseData.paintData = RecordReplayControl.repaint();
ClearPausedState();
const result = convertCompletionValue(rv);
let result;
if (rv.return) {
result = getDebuggeeValue(rv.return);
} else {
result = [getDebuggeeValue(rv.throw)];
}
result = result.map(v => convertValue(makeDebuggeeValue(v)));
const resultData = new PreviewedObjects();
resultData.addCompletionValue(result, true);
result.forEach(v => resultData.addValue(v, true));
RecordReplayControl.manifestFinished({ result, resultData, pauseData });
},
@ -1563,14 +1570,6 @@ PreviewedObjects.prototype = {
}
},
addCompletionValue(value, includeProperties) {
if ("return" in value) {
this.addValue(value.return, includeProperties);
} else if ("throw" in value) {
this.addValue(value.throw, includeProperties);
}
},
addEnvironment(id) {
if (!id || this.environments[id]) {
return;