Confirmed users
497
edits
(You can talk with long string actors without pausing. Fix start/end limits. f7eb054cd4ed895a9f1ee126cdbdd671201ce4df) |
|||
| Line 131: | Line 131: | ||
| ({x:1}) | | ({x:1}) | ||
| { "type":"object", "class":"Object", "actor":"24" } | | { "type":"object", "class":"Object", "actor":"24" } | ||
|} | |} | ||
| Line 320: | Line 317: | ||
{ "from":<i>gripActor</i>, "substring":<i>string</i> } | { "from":<i>gripActor</i>, "substring":<i>string</i> } | ||
where <i>string</i> is the requested portion of the string the actor represents. Values for <i>start</i> less than zero are treated as zero; values greater than the length of the string are treated as the length of the string. Values for <i>end</i> are treated similarly. If <i>end</i> is less than <i>start</i>, the two values are swapped. (This is meant to be the same behavior as JavaScript's <code>String.prototype. | where <i>string</i> is the requested portion of the string the actor represents. Values for <i>start</i> less than zero are treated as zero; values greater than the length of the string are treated as the length of the string. Values for <i>end</i> are treated similarly. If <i>end</i> is less than <i>start</i>, the two values are swapped. (This is meant to be the same behavior as JavaScript's <code>String.prototype.substr</code>.) | ||
Like object grip actors, long string grip actors must only receive messages from the client while the thread is in the <b>Paused</b> state. | |||
== Grip Lifetimes == | == Grip Lifetimes == | ||
| Line 328: | Line 325: | ||
Most grips are <b>pause-lifetime</b> grips: they last only while the JavaScript thread is paused, and become invalid as soon as the debugger allows the thread to resume execution. (The actors in pause-lifetime grips are children of an actor that is closed when the thread resumes, or is detached from.) This arrangement allows the protocol to use grips freely in responses without requiring the client to remember and close them all. | Most grips are <b>pause-lifetime</b> grips: they last only while the JavaScript thread is paused, and become invalid as soon as the debugger allows the thread to resume execution. (The actors in pause-lifetime grips are children of an actor that is closed when the thread resumes, or is detached from.) This arrangement allows the protocol to use grips freely in responses without requiring the client to remember and close them all. | ||
However, in some cases the client may wish to retain a reference to an object | However, in some cases the client may wish to retain a reference to an object while the debuggee runs. For example, a panel displaying objects selected by the user must update its view of the objects each time the debuggee pauses. To carry this out, the client can promote a pause-lifetime grip to a <b>thread-lifetime</b> grip, which lasts until the thread is detached from or exits. Actors in thread-lifetime grips are children of the thread actor. When the client no longer needs a thread-lifetime grip, it can explicitly release it. | ||
Both pause-lifetime and thread-lifetime grips are garbage collection roots. | Both pause-lifetime and thread-lifetime grips are garbage collection roots. | ||
| Line 364: | Line 361: | ||
{ "from":<i>thread</i> } | { "from":<i>thread</i> } | ||
Regardless of the lifetime of a grip, the client may only send messages to | Regardless of the lifetime of a grip, the client may only send messages to grip actors while the thread to which they belong is paused; the client's interaction with values cannot take place concurrently with the thread. | ||
= Completion Values = | = Completion Values = | ||