JsDebugEvent Struct
A statement that is about to run, given to the methods of JsDebugger.
public readonly struct JsDebugEventProperties
| Name | Description |
|---|---|
| CallDepth | Gets the number of JavaScript frames on the stack, the frame of the statement included (1 for the top-level code of a script). A debugger compares it to step over (the next statement with a depth less than or equal) or out of a function (a smaller depth). |
| Engine | Gets the engine that runs the statement. |
| FunctionName | Gets the name of the function that contains the statement, or null for the top-level code and the anonymous functions. |
| Location | Gets the position of the start of the statement. |
| Realm | Gets the realm of the code of the statement. |
CallDepth
JsDebugger.csGets the number of JavaScript frames on the stack, the frame of the statement included (1 for the top-level code of a script). A debugger compares it to step over (the next statement with a depth less than or equal) or out of a function (a smaller depth).
public int CallDepth { get; }Property value
Engine
JsDebugger.csFunctionName
JsDebugger.csLocation
JsDebugger.csGets the position of the start of the statement.
public JsSourceLocation Location { get; }Property value
Realm
JsDebugger.csMethods
| Name | Description |
|---|---|
| CaptureStackTrace() | Captures the stack trace of the running code, in the format of the stack property of the errors (without the first line). |
| Evaluate(string) | Evaluates code at the position of the statement, like a direct eval: it reads and changes the variables of the statement. |
| GetCallStack() | Gets the JavaScript frames of the stack, the frame of the statement first, then its callers. |
| GetScopes() | Gets the scopes of the statement, the innermost first: its variables, and the ones of the enclosing blocks, functions and global scope. |
CaptureStackTrace()
JsDebugger.csEvaluate(string)
JsDebugger.csEvaluates code at the position of the statement, like a direct eval: it reads and changes the variables of the statement.
Parameters
codestring- The code, e.g. an expression.
Returns
JsValue The completion value of the code.
Exceptions
InvalidOperationException- The callback that received the event returned.
JsException- The code throws, or it has a syntax error.
GetCallStack()
JsDebugger.csGets the JavaScript frames of the stack, the frame of the statement first, then its callers.
public IReadOnlyList<JsDebugFrame> GetCallStack()Returns
IReadOnlyList<JsDebugFrame> The frames. They can be used until the callback that received the event returns.
Exceptions
InvalidOperationException- The callback that received the event returned.
GetScopes()
JsDebugger.csGets the scopes of the statement, the innermost first: its variables, and the ones of the enclosing blocks, functions and global scope.
public IReadOnlyList<JsDebugScope> GetScopes()