JsDebugFrame Class
A JavaScript frame of the stack of a statement given to a JsDebugger: a function call, or the top-level code of a script, a module or eval code (JsDebugEvent.GetCallStack). It can be used until the callback that received the event returns.
public sealed class JsDebugFrameProperties
| Name | Description |
|---|---|
| Function | Gets the function of the frame, or null for the top-level code of a script, a module or eval code. |
| FunctionName | Gets the name of the function of the frame, or null for the top-level code and the anonymous functions. |
| Location | Gets the position of the statement of the frame (the paused statement), or of the call that the frame is running. |
| Realm | Gets the realm of the code of the frame. |
Function
JsDebugFrame.csGets the function of the frame, or null for the top-level code of a script, a module or eval code.
public JsFunction? Function { get; }Property value
FunctionName
JsDebugFrame.csLocation
JsDebugFrame.csGets the position of the statement of the frame (the paused statement), or of the call that the frame is running.
public JsSourceLocation Location { get; }Property value
Realm
JsDebugFrame.csMethods
| Name | Description |
|---|---|
| Evaluate(string) | Evaluates code at the position of the frame, like a direct eval written there: it reads and changes the variables of the frame, and uses its this, new.target and super. The code raises no event of the debugger, and the host is not asked whether it can be compiled (JsEngineOptions.AllowStringCompilation, JsHost.EnsureCanCompileStrings). |
| GetScopes() | Gets the scopes of the frame at its position, the innermost first: the blocks, the function (JsDebugScopeKind.Local), the enclosing functions (JsDebugScopeKind.Closure), then the global scope. The scopes that have no variable are omitted, except the global object. |
Evaluate(string)
JsDebugFrame.csEvaluates code at the position of the frame, like a direct eval written there: it reads and changes the variables of the frame, and uses its this, new.target and super. The code raises no event of the debugger, and the host is not asked whether it can be compiled (JsEngineOptions.AllowStringCompilation, JsHost.EnsureCanCompileStrings).
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.
GetScopes()
JsDebugFrame.csGets the scopes of the frame at its position, the innermost first: the blocks, the function (JsDebugScopeKind.Local), the enclosing functions (JsDebugScopeKind.Closure), then the global scope. The scopes that have no variable are omitted, except the global object.
public IReadOnlyList<JsDebugScope> GetScopes()