Skip to content

Commit

Permalink
Support privileged evaluations (#963)
Browse files Browse the repository at this point in the history
  • Loading branch information
bhackett1024 committed Mar 22, 2023
1 parent c4fe9dd commit 7777175
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion build.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ function getRevisionDate(
* When changing this: always keep all versions of this in sync, or else, builds will break.
*/
function computeBuildId() {
const geckoRevision = spawnChecked("git", ["rev-parse", "--short", "HEAD"]).stdout.toString().trim();
const geckoRevision = spawnChecked("git", ["rev-parse", "--short=12", "HEAD"]).stdout.toString().trim();

const runtimeDate = getRevisionDate();

Expand Down
6 changes: 6 additions & 0 deletions devtools/server/actors/replay/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -709,6 +709,7 @@ const commands = {
"Target.getCurrentNetworkRequestEvent": Target_getCurrentNetworkRequestEvent,
"Target.getCurrentNetworkStreamData": Target_getCurrentNetworkStreamData,
"Target.getPossibleBreakpointsForMultipleSources": Target_getPossibleBreakpointsForMultipleSources,
"Target.evaluatePrivileged": Target_evaluatePrivileged,
};

function OnProtocolCommand(method, params) {
Expand Down Expand Up @@ -1025,6 +1026,11 @@ function Target_getPossibleBreakpointsForMultipleSources({ sourceIds }) {
};
}

function Target_evaluatePrivileged({ expression }) {
const result = eval(expression);
return { result };
}

function GetPossibleBreakpoints(sourceId) {
const source = protocolSourceIdToSource(sourceId);

Expand Down

0 comments on commit 7777175

Please sign in to comment.