Skip to content

API reference / @jsprismarine/script-host / debugger/EngineDebugger

debugger/EngineDebugger ​

Classes ​

Interfaces ​

DebugFrame ​

Defined in: script-host/src/debugger/EngineDebugger.ts:52

One frame of a stopped script's stack.

Properties ​

column ​

readonly column: number

Defined in: script-host/src/debugger/EngineDebugger.ts:60

The 1-based column, 0 in a native frame.

file ​

readonly file: string

Defined in: script-host/src/debugger/EngineDebugger.ts:56

The file name, as the script's stack traces show it; empty for a native frame.

line ​

readonly line: number

Defined in: script-host/src/debugger/EngineDebugger.ts:58

The 1-based line, 0 in a native frame.

name ​

readonly name: string

Defined in: script-host/src/debugger/EngineDebugger.ts:54

The function's name, empty for an anonymous one.


DebugProperty ​

Defined in: script-host/src/debugger/EngineDebugger.ts:76

One own property of an object, read without running its getter.

Properties ​

accessor ​

readonly accessor: boolean

Defined in: script-host/src/debugger/EngineDebugger.ts:79

True for a getter or setter, whose value the debugger never reads.

name ​

readonly name: string

Defined in: script-host/src/debugger/EngineDebugger.ts:77

value ​

readonly value: ScriptValue

Defined in: script-host/src/debugger/EngineDebugger.ts:81

The value, which the caller frees when it is a handle. Undefined for an accessor.


DebuggerHost ​

Defined in: script-host/src/debugger/EngineDebugger.ts:92

What a debugger needs of its engine; ScriptEngine provides it.

Properties ​

buffer ​

readonly buffer: TransferBuffer

Defined in: script-host/src/debugger/EngineDebugger.ts:94

native ​

readonly native: NativeSymbols

Defined in: script-host/src/debugger/EngineDebugger.ts:93

Methods ​

check() ​

check(result): number

Defined in: script-host/src/debugger/EngineDebugger.ts:98

Turns a negative status into the error the engine described.

Parameters ​
result ​

number

Returns ​

number

detached() ​

detached(): void

Defined in: script-host/src/debugger/EngineDebugger.ts:102

Tells the engine the debugger has detached.

Returns ​

void

pointer() ​

pointer(): bigint

Defined in: script-host/src/debugger/EngineDebugger.ts:96

The engine's pointer, or a throw once it has been destroyed.

Returns ​

bigint

take() ​

take(handle): ScriptValue

Defined in: script-host/src/debugger/EngineDebugger.ts:100

Reads a result handle's value, freeing the handle unless the value is an object.

Parameters ​
handle ​

number

Returns ​

ScriptValue


DebuggerListener ​

Defined in: script-host/src/debugger/EngineDebugger.ts:37

Receives the engine's debugger events. Both run synchronously on the engine's thread, inside the engine call that runs the script, so the script and everything waiting on it stay blocked.

Methods ​

paused() ​

paused(reason): PauseOutcome

Defined in: script-host/src/debugger/EngineDebugger.ts:43

The script stopped. The listener reads it through the EngineDebugger, calls EngineDebugger.resume to say how it goes on, and returns. Returning 'terminate' stops the script as if it had run out of steps.

Parameters ​
reason ​

"breakpoint" | "step" | "exception" | "pause"

Returns ​

PauseOutcome

poll() ​

poll(): void

Defined in: script-host/src/debugger/EngineDebugger.ts:48

A running script has passed the number of lines the debugger polls at. The listener reads what the debugger has sent without waiting, and must not run script.

Returns ​

void


PropertyPage ​

Defined in: script-host/src/debugger/EngineDebugger.ts:85

A page of an object's own properties.

Properties ​

properties ​

readonly properties: readonly DebugProperty[]

Defined in: script-host/src/debugger/EngineDebugger.ts:88

total ​

readonly total: number

Defined in: script-host/src/debugger/EngineDebugger.ts:87

How many own properties the object has in all.


ValueDescription ​

Defined in: script-host/src/debugger/EngineDebugger.ts:67

A value the engine described without running script.

Properties ​

detail ​

readonly detail: string | number | undefined

Defined in: script-host/src/debugger/EngineDebugger.ts:72

An array's length or an error's message.

kind ​

readonly kind: DescribedKind

Defined in: script-host/src/debugger/EngineDebugger.ts:68

name ​

readonly name: string | undefined

Defined in: script-host/src/debugger/EngineDebugger.ts:70

A constructor's or function's name, a symbol's description or a bigint's digits.

Type Aliases ​

DescribedKind ​

DescribedKind = "object" | "array" | "function" | "error" | "proxy" | "symbol" | "bigint"

Defined in: script-host/src/debugger/EngineDebugger.ts:64

The kinds of value EngineDebugger.describe tells apart.


PauseOutcome ​

PauseOutcome = "resume" | "terminate"

Defined in: script-host/src/debugger/EngineDebugger.ts:31

What the host does with a script once it has handled a stop.


PauseReason ​

PauseReason = typeof PauseReason[number]

Defined in: script-host/src/debugger/EngineDebugger.ts:13

Why a script stopped: at a breakpoint, after a step, on a thrown value, or on request.


ResumeMode ​

ResumeMode = keyof typeof ResumeMode

Defined in: script-host/src/debugger/EngineDebugger.ts:19

How a stopped script goes on.


ScopeKind ​

ScopeKind = keyof typeof ScopeKind

Defined in: script-host/src/debugger/EngineDebugger.ts:25

Which variables of a frame a scope holds: its own, those it closes over, or the global object.

Variables ​

PauseReason ​

const PauseReason: readonly ["breakpoint", "step", "exception", "pause"]

Defined in: script-host/src/debugger/EngineDebugger.ts:13

Why a script stopped, by the jsh_debug_reason code the engine sends.


ResumeMode ​

const ResumeMode: object

Defined in: script-host/src/debugger/EngineDebugger.ts:19

How a stopped script goes on, by its jsh_debug_resume code.

Type Declaration ​

continue ​

readonly continue: 0 = 0

stepIn ​

readonly stepIn: 2 = 2

stepOut ​

readonly stepOut: 3 = 3

stepOver ​

readonly stepOver: 1 = 1


ScopeKind ​

const ScopeKind: object

Defined in: script-host/src/debugger/EngineDebugger.ts:25

The variables of a frame, by their jsh_debug_scope code.

Type Declaration ​

closure ​

readonly closure: 1 = 1

global ​

readonly global: 2 = 2

local ​

readonly local: 0 = 0