Skip to content

devtools: Implement debugger Eval event - #42306

Merged
atbrakhi merged 2 commits into
servo:mainfrom
atbrakhi:devtools_implement_eval
Feb 9, 2026
Merged

atbrakhi merged 2 commits into
servo:mainfrom
atbrakhi:devtools_implement_eval

Conversation

@atbrakhi

@atbrakhi atbrakhi commented Feb 3, 2026 •

Copy link
Copy Markdown
Member

Replace the EvaluateJS function to use debugger.js Eval event and the proper context. This takes the global context and calls executeInGlobal.

In future we also add the version that takes a frame and calls eval.

Testing: No new tests added yet, Old tests are not impacted by this change.
Fixes: Part of #36027

@atbrakhi
atbrakhi force-pushed the devtools_implement_eval branch from 168ba9f to e57be17 Compare February 4, 2026 08:54
@atbrakhi
atbrakhi marked this pull request as ready for review February 4, 2026 09:00
@atbrakhi
atbrakhi requested a review from gterzian as a code owner February 4, 2026 09:01
@servo-highfive servo-highfive added the S-awaiting-review There is new code that needs to be reviewed. label Feb 4, 2026
@atbrakhi atbrakhi changed the title devtools: implement debugger Eval event devtools: Implement debugger Eval event Feb 4, 2026
@atbrakhi
atbrakhi requested review from eerii and jdm February 4, 2026 11:03
@servo-highfive servo-highfive removed the S-awaiting-review There is new code that needs to be reviewed. label Feb 4, 2026
Comment thread resources/debugger.js
// <https://firefox-source-docs.mozilla.org/js/Debugger/Debugger.Object.html#executeinglobal-code-options>
addEventListener("eval", event => {
const {code, pipelineId: {namespaceId, index}, workerId} = event;
let object = debuggeesToPipelineIds.keys().next().value;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we be getting a specific key from the map, not just the first one?

@atbrakhi atbrakhi Feb 9, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, we already have a patch for this in upcoming PR. initially we left it this way thinking we have only one debuggee so should be alright but we realize in our upcoming changes that it's better to take care of this!

@atbrakhi
atbrakhi added this pull request to the merge queue Feb 9, 2026
@servo-highfive servo-highfive added the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Feb 9, 2026
Merged via the queue into servo:main with commit d6097d1 Feb 9, 2026
34 checks passed
@atbrakhi
atbrakhi deleted the devtools_implement_eval branch February 9, 2026 13:48
@servo-highfive servo-highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Feb 9, 2026
@eerii eerii mentioned this pull request Mar 4, 2026
@delan

delan commented Mar 13, 2026 •

Copy link
Copy Markdown
Member

hi! i’m preparing the monthly update, and i was wondering if this patch changes the way devtools behaves for the end user in any way? or is expected to enable some future extension to our behaviour?

@eerii

eerii commented Mar 13, 2026

Copy link
Copy Markdown
Member

Hi! This alone doesn't change anything, but it was preparatory work for #42936. That one does make a difference for the end user. Now when you are paused on the debugger and you hover over variables you can see the values they have at that point in time. There's also #42994 and #42996 which improve this popup overview.

@eerii eerii mentioned this pull request Apr 16, 2026
24 of 37 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants