-
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
-
handle
number - the Crossfire identifier for this breakpoint object
-
type
string - the type of the breakpoint - for example `line` or `error`
-
location
object - the object that contains location information
-
attributes
object - 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_id
string - the id of the context
-
url
string - the URL opened in the context (tab)
-
is_current
boolean - 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
-
index
number - the index of the frame within the complete stack of frames from the debugger
-
line_number
number - the line number the frame is currently suspended on
-
functionName
string - the name of the function the frame is currently suspended in
-
url
string - the URL of the script the frame is suspended in
-
locals
object - the object containing the group of local variables for the frame
-
scopes
object - 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
-
index
number - the index of the scope in the complete array of scopes
-
frame_index
number - the index of the frame this scope aligns with
-
closing_object
object - 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
-
url
string - the URL of the script
-
line_offset
number - the current line offset of the script within its parent (if any)
-
column_offset
number - the current column offset of the script within its parent (if any)
-
source_length
number - the entire length of the source for the script including all control characters
-
line_count
number - the number of lines in the script
-
type
string - 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
-
source
string - 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
-
name
string - the name of the tool
-
enabled_state
boolean - the enabled state of the tool (true or false)
-
command_array
object - the array of the names of the commands this tool supports
-
event_array
object - the array of the names of the events this tool is capable of sending
-
description
string - the human-readable description of the tool
An undefined
value is represented as:
{
"myfunction":"undefined"
}