Closed
Bug 904739
Opened 11 years ago
Closed 11 years ago
rename actors' grip/form methods to toJSON
Categories
(DevTools :: Debugger, defect, P3)
Tracking
(Not tracked)
RESOLVED
DUPLICATE
of bug 698841
People
(Reporter: fitzgen, Unassigned)
Details
(Whiteboard: [debugger-docs-needed])
This is something that it seems like everyone who works on the debugger server gets confused about. No one knows what a grip or a form is, or how they are different (which we also mess up fairly frequently). It would be a lot more obvious if we just rename them all toJSON, and then we can get the magical JSON.stringify'ing auto-calling toJSON as an added bonus (no more thing.grip() all over the place when sending packets, just use thing! woo!).
Comment 1•11 years ago
|
||
Hi,
I am willing to work on this bug. So, I request you to assign me to this bug.
Thanks in Advance,
Regards,
A. Anup
Reporter | ||
Comment 2•11 years ago
|
||
Anup, I don't think this is a good bug to work on just yet, I expect there to be some discussion and decisions to be made first.
Take a look at one of these instead: https://bugzilla.mozilla.org/buglist.cgi?j_top=OR&f1=component&list_id=7519021&o1=allwords&resolution=---&emailtype1=exact&status_whiteboard_type=allwordssubstr&emailassigned_to1=1&query_format=advanced&status_whiteboard=mentor%3D&bug_status=UNCONFIRMED&bug_status=NEW&bug_status=REOPENED&bug_status=VERIFIED&email1=nobody%40mozilla.org&v1=Developer%20Tools&product=Firefox
Comment 3•11 years ago
|
||
I like the toJSON idea a lot. The actors would just get toJSON methods, and then we'd stick them directly in the packets, right?
But we need a precise, quick term that means what "grip" does now. Where the protocol spec says things like:
"This represents an environment introduced by a <tt>with</tt> statement whose operand is <i>object</i> (a grip)."
how would we write that sentence now, in a way that *spells out* what <i>object</i> must be? The spec is not the place to say, "ah, everyone knows that I really mean a grip when I say 'value'," right?
Comment 4•11 years ago
|
||
(In reply to Jim Blandy :jimb from comment #3)
> I like the toJSON idea a lot. The actors would just get toJSON methods, and
> then we'd stick them directly in the packets, right?
... except that we don't really use JSON.stringify in LocalDebuggerTransport or ChildDebuggerTransport.
Comment 5•11 years ago
|
||
(In reply to Jim Blandy :jimb from comment #4)
> (In reply to Jim Blandy :jimb from comment #3)
> > I like the toJSON idea a lot. The actors would just get toJSON methods, and
> > then we'd stick them directly in the packets, right?
>
> ... except that we don't really use JSON.stringify in LocalDebuggerTransport
> or ChildDebuggerTransport.
And hopefully we don't run into any more bugs because of the differences between freezing and JSON encoding.
> freeze({ foo: Infinity, bar: -0 })
> { foo: Infinity, bar: 0 }
> remotify({ foo: Infinity }, bar: -0 })
> { foo: { type: "Infinity" }, bar: { type: "-0" } }
Reporter | ||
Comment 6•11 years ago
|
||
(In reply to Jim Blandy :jimb from comment #4)
> (In reply to Jim Blandy :jimb from comment #3)
> > I like the toJSON idea a lot. The actors would just get toJSON methods, and
> > then we'd stick them directly in the packets, right?
>
> ... except that we don't really use JSON.stringify in LocalDebuggerTransport
> or ChildDebuggerTransport.
D'oh, you are correct. I still think toJSON is a better name event without the nice magic.
Reporter | ||
Updated•11 years ago
|
Whiteboard: [debugger-docs-needed]
Comment 8•11 years ago
|
||
Bikeshed the name! The concept is sound (normalizing how we name this stuff and make it more self-explanatory).
toRemote
remotify
remotable
transportable
Or even toGrip, along with a detailed explanation of what a "grip" is. At the very least, the name "form" needs to go because it has no explanatory power at all.
Reporter | ||
Comment 9•11 years ago
|
||
remotify is pretty good: "... whose operand is object (remotified)"
I also like plain old "serialize": "... whose operand is object (serialized)."
Comment 10•11 years ago
|
||
+1 for serialize.
(I was going to suggest "pickle" just to introduce a pythonism)
Reporter | ||
Updated•11 years ago
|
Priority: -- → P3
Reporter | ||
Comment 11•11 years ago
|
||
This should just go away...
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → DUPLICATE
Updated•6 years ago
|
Product: Firefox → DevTools
You need to log in
before you can comment on or make changes to this bug.
Description
•