-
Notifications
You must be signed in to change notification settings - Fork 8
Values
Values typically appear in the responses of commands like backtrace, frame, lookup and scopes as serialized JavaScript values.
The JSON structure of these objects contains a type field, along with either a type-specific value field or, in the case of object and function values, a handle field whose value can be used to obtain the actual object/function with the lookup command.
A boolean is represented as:
{
"myboolean":{
"type":"boolean",
"value":<true_or_false>
}
}
A breakpoint object describes a single breakpoint from Crossfire. This object can be found in the getBreakpoints and setBreakpoints responses as well as the onToggleBreakpoint event.
{
"handle":<handle>,
"type":<type>,
"location":<location>,
"attributes":<attributes>
}
Values
-
handlenumber - the Crossfire identifier for this breakpoint object
-
typestring - the type of the breakpoint - for example `line` or `error`
-
locationobject - the object that contains location information
-
attributesobject - the object of attributes that describe the breakpoint - for example `enabled` or `condition`
A context object describes a given context (tab) in Crossfire. This object can be found in the listcontexts response.
{
"contextId":<context_id>,
"url":<url>,
"current":<is_current>
}
Values
-
context_idstring - the id of the context
-
urlstring - the URL opened in the context (tab)
-
is_currentboolean - if the context is the focus context
A frame object describes a single stackframe from the debugger. This object can be found in the backtrace and frame responses.
{
"index":<index>,
"line":<line_number>,
"functionName":<func_name>,
"url":<url>,
"locals":<variable_objects>,
"scopes":<scope_array>
}
Values
-
indexnumber - the index of the frame within the complete stack of frames from the debugger
-
line_numbernumber - the line number the frame is currently suspended on
-
functionNamestring - the name of the function the frame is currently suspended in
-
urlstring - the URL of the script the frame is suspended in
-
localsobject - the object containing the group of local variables for the frame
-
scopesobject - the array of [scope objects](#scope)
A function is represented as a handle of the form:
{
"myfunction":{
"type":"function",
"handle":<number>
}
}
A number is represented as:
{
"mynumber":{
"type":"number",
"value":<number_or_string>
}
}
number_or_string must be either a number or one of NaN, Infinity or -Infinity.
A null value is represented as:
{
"mystring":null
}
An object is represented as a handle of the form:
{
"myobject":{
"type":"object",
"handle":<number>
}
}
Objects can also be nested within other objects. For example in the case of a backtrace request, you will receive a response with variables split up as locals and this.
Nested objects will always appear as a value entry in the object.
For example:
{
"myobject":{
"type":"object",
"value":{
"mynestedobj":{"type":"object","handle":<number>}
}
}
}
A scope object represents a logical grouping for a given set of local variables.
This object can be found in a stack frame object and in the scopes response.
{
"index": <index>,
"frameIndex": <frame_index>,
"scope": <scope_object>
}
Values
-
indexnumber - the index of the scope in the complete array of scopes
-
frame_indexnumber - the index of the frame this scope aligns with
-
closing_objectobject - the [serialized object handle](#wiki-object) of the object that makes up this scope
A script object describes a single script. This object can be found in the scripts response and the onScript event.
{
"url":<url>,
"lineOffset":<line_offset>,
"columnOffset":<column_offset>,
"sourceLength":<source_length>,
"lineCount":<line_count>,
"type":<type>,
"source":<source>
}
Values
-
urlstring - the URL of the script
-
line_offsetnumber - the current line offset of the script within its parent (if any)
-
column_offsetnumber - the current column offset of the script within its parent (if any)
-
source_lengthnumber - the entire length of the source for the script including all control characters
-
line_countnumber - the number of lines in the script
-
typestring - the type of the compilation unit - see [sourceFile.js](http://code.google.com/p/fbug/source/browse/branches/firebug1.7/content/firebug/sourceFile.js) for complete listing of types
-
sourcestring - the complete source of the script
A string is represented as:
{
"mystring":{
"type":"string",
"value":"string_value"
}
}
A tool object describes a default or contributed tool. This object can be found in the gettools, enabletools and disabletools responses.
{
"name":<name>,
"enabled":<enabled_state>,
"commands":<command_array>,
"events":<event_array>,
"desc":<description>
}
Values
-
namestring - the name of the tool
-
enabled_stateboolean - the enabled state of the tool (true or false)
-
command_arrayobject - the array of the names of the commands this tool supports
-
event_arrayobject - the array of the names of the events this tool is capable of sending
-
descriptionstring - the human-readable description of the tool
An undefined value is represented as:
{
"myfunction":"undefined"
}