-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
devtools: Implement frame scoped evaluation #42936
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -149,9 +149,8 @@ pub enum DomMutation { | |
| } | ||
|
|
||
| /// Serialized JS return values | ||
| /// TODO: generalize this beyond the EvaluateJS message? | ||
| #[derive(Debug, Deserialize, Serialize)] | ||
| pub enum EvaluateJSReply { | ||
| pub enum EvaluateJSReplyValue { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Very small nits, but maybe this can be simplified to Also, I'm not sure why
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I spent lots of time on this renaming. My other option was also I think we will be touching this function more in coming weeks, how do you feel about landing it the way it is and renaming it later?...i am hoping to find something better
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, it is a tricky naming choice indeed. I agree that we should think about it and rename it later :) |
||
| VoidValue, | ||
| NullValue, | ||
| BooleanValue(bool), | ||
|
|
@@ -160,6 +159,12 @@ pub enum EvaluateJSReply { | |
| ActorValue { class: String, uuid: String }, | ||
| } | ||
|
|
||
| #[derive(Debug, Deserialize, Serialize)] | ||
| pub struct EvaluateJSReply { | ||
| pub value: EvaluateJSReplyValue, | ||
| pub has_exception: bool, | ||
| } | ||
|
|
||
| #[derive(Debug, Deserialize, Serialize)] | ||
| pub struct AttrInfo { | ||
| pub namespace: String, | ||
|
|
@@ -333,7 +338,12 @@ pub enum DevtoolScriptControlMsg { | |
| /// Highlight the given DOM node | ||
| HighlightDomNode(PipelineId, Option<String>), | ||
|
|
||
| Eval(String, PipelineId, GenericSender<EvaluateJSReply>), | ||
| Eval( | ||
| String, | ||
| PipelineId, | ||
| Option<String>, | ||
| GenericSender<EvaluateJSReply>, | ||
| ), | ||
| GetPossibleBreakpoints(u32, GenericSender<Vec<RecommendedBreakpointLocation>>), | ||
| SetBreakpoint(u32, u32, u32), | ||
| ClearBreakpoint(u32, u32, u32), | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I needed to do what this comment said, to introduce a
has_exceptionfield inEvaluateJSReply. Introducing this resolved the reference error we see in screenshot of the previous comment.