зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1176880 part 3 - Debugger.Script.getOffsetsCoverage: Add documentation. r=shu
This commit is contained in:
Родитель
e9e0015186
Коммит
64c0db4ea9
|
@ -202,6 +202,7 @@ methods of other kinds of objects.
|
|||
{ lineNumber: 1, columnNumber: 5, offset: 5 },
|
||||
{ lineNumber: 1, columnNumber: 10, offset: 20 },
|
||||
{ lineNumber: 3, columnNumber: 4, offset: 10 }]
|
||||
```
|
||||
|
||||
<code>getLineOffsets(<i>line</i>)</code>
|
||||
: Return an array of bytecode instruction offsets representing the entry
|
||||
|
@ -212,6 +213,23 @@ methods of other kinds of objects.
|
|||
: Return the source code line responsible for the bytecode at
|
||||
<i>offset</i> in this script.
|
||||
|
||||
`getOffsetsCoverage()`:
|
||||
: Return `null` or an array which contains informations about the coverage of
|
||||
all opcodes. The elements of the array are objects, each of which describes
|
||||
a single opcode, and contains the following properties:
|
||||
|
||||
* lineNumber: the line number of the current opcode.
|
||||
|
||||
* columnNumber: the column number of the current opcode.
|
||||
|
||||
* offset: the bytecode instruction offset of the current opcode.
|
||||
|
||||
* count: the number of times the current opcode got executed.
|
||||
|
||||
If this script has no coverage, or if it is not instrumented, then this
|
||||
function will return `null`. To ensure that the debuggee is instrumented,
|
||||
the flag `Debugger.collectCoverageInfo` should be set to `true`.
|
||||
|
||||
`getChildScripts()`
|
||||
: Return a new array whose elements are Debugger.Script objects for each
|
||||
function and each generator expression in this script. Only direct
|
||||
|
|
|
@ -37,6 +37,24 @@ its prototype:
|
|||
Debugger API (e.g, [`Debugger.Source`][source]) for purposes other than
|
||||
step debugging a target JavaScript program.
|
||||
|
||||
`collectCoverageInfo`
|
||||
: A boolean value indicating whether code coverage should be enabled inside
|
||||
each debuggee of this `Debugger` instance. Changing this flag value will
|
||||
recompile all JIT code to add or remove code coverage
|
||||
instrumentation. Changing this flag when any frame of the debuggee is
|
||||
currently active on the stack will produce an exception.
|
||||
|
||||
Setting this to `true` enables code coverage instrumentation, which can be
|
||||
accessed via the [`Debugger.Script`][script] `getOffsetsCoverage`
|
||||
function. In some cases, the code coverage might expose information which
|
||||
pre-date the modification of this flag. Code coverage reports are monotone,
|
||||
thus one can take a snapshot when the Debugger is enabled, and output the
|
||||
difference.
|
||||
|
||||
Setting this to `false` prevents this `Debugger` instance from requiring any
|
||||
code coverage instrumentation, but it does not guarantee that the
|
||||
instrumentation is not present.
|
||||
|
||||
`uncaughtExceptionHook`
|
||||
: Either `null` or a function that SpiderMonkey calls when a call to a
|
||||
debug event handler, breakpoint handler, watchpoint handler, or similar
|
||||
|
|
Загрузка…
Ссылка в новой задаче