Closed
Bug 819049
Opened 13 years ago
Closed 13 years ago
JS debugging protocol: provide function names in grips
Categories
(DevTools :: Debugger, defect)
DevTools
Debugger
Tracking
(Not tracked)
RESOLVED
FIXED
Firefox 20
People
(Reporter: jimb, Assigned: jimb)
Details
Attachments
(4 files)
3.71 KB,
patch
|
past
:
review+
|
Details | Diff | Splinter Review |
2.76 KB,
patch
|
past
:
review+
|
Details | Diff | Splinter Review |
2.07 KB,
patch
|
past
:
review+
|
Details | Diff | Splinter Review |
5.44 KB,
patch
|
past
:
review+
|
Details | Diff | Splinter Review |
In the remote debugging protocol, "grips" are supposed to provide enough information to display a brief summary of the object, without further round trips. I'd like to expand the object grips for functions to include their names, whether explicit, inferred, or provided by the developer.
Draft documentation is here:
https://github.com/jimblandy/DebuggerDocs/compare/master...displayName
Quick summary: function grips would look like this:
{ "type":"object", "class":"Function", "actor":<i>actor</i>,
"name":<i>name</i>, "displayName":<i>displayName</i>,
"userDisplayName":<i>userDisplayName</i> }
We can then drop the 'calleeName' and 'functionName' properties from frame and environment forms, as those forms also include function grips; the *Name properties would be redundant.
The nameAndParameters request can then become simply parameterNames.
Assignee | ||
Comment 1•13 years ago
|
||
Attachment #689346 -
Flags: review?(past)
Assignee | ||
Comment 2•13 years ago
|
||
Assignee | ||
Comment 3•13 years ago
|
||
Attachment #689350 -
Flags: review?(past)
Assignee | ||
Comment 4•13 years ago
|
||
Attachment #689351 -
Flags: review?(past)
Assignee | ||
Comment 5•13 years ago
|
||
Those patches, applied in the order they were attached, implement the changes described by the github link in comment 0. Each is supposed to be a self-contained step towards the goal: Debugger xpcshell tests and mochitests should pass after each one individually.
Try run with all four patches applied:
https://tbpl.mozilla.org/?tree=Try&rev=031482e12675
Updated•13 years ago
|
Attachment #689348 -
Flags: review?(past) → review+
Comment 6•13 years ago
|
||
Comment on attachment 689346 [details] [diff] [review]
JS debugging protocol: provide 'name', 'displayName', and 'userDisplayName' properties on function grips.
Review of attachment 689346 [details] [diff] [review]:
-----------------------------------------------------------------
Just some nits.
::: toolkit/devtools/debugger/server/dbg-script-actors.js
@@ +1515,5 @@
> + if (this.obj.class === "Function") {
> + if (this.obj.name)
> + g.name = this.obj.name;
> + else if (this.obj.displayName)
> + g.displayName = this.obj.displayName;
Firefox JS code style requires curlies even for single-line blocks.
::: toolkit/devtools/debugger/tests/unit/test_functiongrips-01.js
@@ +75,5 @@
> +
> + do_check_eq(args[0].class, "Function");
> + // No name for an anonymous function, but it should have an inferred name.
> + do_check_eq(args[0].name, undefined);
> + do_check_eq(args[0].displayName, undefined);
The comment suggests that displayName shouldn't be undefined, so I guess the comment is wrong.
Attachment #689346 -
Flags: review?(past) → review+
Updated•13 years ago
|
Attachment #689350 -
Flags: review?(past) → review+
Updated•13 years ago
|
Attachment #689351 -
Flags: review?(past) → review+
Assignee | ||
Comment 7•13 years ago
|
||
(In reply to Panos Astithas [:past] from comment #6)
> Firefox JS code style requires curlies even for single-line blocks.
Fixed --- thanks!
> The comment suggests that displayName shouldn't be undefined, so I guess the
> comment is wrong.
I fixed the comment.
Assignee | ||
Comment 8•13 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/909ffcf23f83
https://hg.mozilla.org/integration/mozilla-inbound/rev/3686e1e8845f
https://hg.mozilla.org/integration/mozilla-inbound/rev/62d11f7658cc
https://hg.mozilla.org/integration/mozilla-inbound/rev/972ff78e9907
Flags: in-testsuite+
Target Milestone: --- → Firefox 20
Comment 9•13 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/909ffcf23f83
https://hg.mozilla.org/mozilla-central/rev/3686e1e8845f
https://hg.mozilla.org/mozilla-central/rev/62d11f7658cc
https://hg.mozilla.org/mozilla-central/rev/972ff78e9907
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Updated•7 years ago
|
Product: Firefox → DevTools
You need to log in
before you can comment on or make changes to this bug.
Description
•