Class JintScriptRunner

Namespace
Kuestenlogik.Bowire.Scripting
Assembly
Kuestenlogik.Bowire.Scripting.dll

Runs scripts with the workbench's own runtime, wwwroot/js/scripts.js, in Jint (#672). The browser and bowire test therefore build the same ctx from the same code: what the conformance suite checks is the engine, not two implementations of one API.

public sealed class JintScriptRunner : IBowireScriptRunner
Inheritance
JintScriptRunner
Implements
Inherited Members

Remarks

Sandbox: Jint exposes no .NET types unless asked to, so a script has no file system, no process and no network. Every run gets a fresh engine with a wall-clock timeout, a memory ceiling, a statement limit and a recursion limit; reaching one stops the script with a .NET exception the script cannot catch, and the run reports it.

Constructors

JintScriptRunner()

public JintScriptRunner()

Methods

RunPostResponse(BowireScriptCall)

Run a post-response script against Response.

public BowireScriptResult RunPostResponse(BowireScriptCall script)

Parameters

script BowireScriptCall

Returns

BowireScriptResult

RunPostResponseAsync(BowireScriptCall, CancellationToken)

#1111 — RunPostResponse(BowireScriptCall) for a script that may await.

public ValueTask<BowireScriptResult> RunPostResponseAsync(BowireScriptCall script, CancellationToken ct = default)

Parameters

script BowireScriptCall
ct CancellationToken

Returns

ValueTask<BowireScriptResult>

RunPreRequest(BowireScriptCall)

Run a pre-request script; it may change Request.

public BowireScriptResult RunPreRequest(BowireScriptCall script)

Parameters

script BowireScriptCall

Returns

BowireScriptResult

RunPreRequestAsync(BowireScriptCall, CancellationToken)

#1111 — run a pre-request script that may await: a ctx.sendRequest goes out through SendRequest while the script waits. The default runs it as RunPreRequest(BowireScriptCall), for a runner that predates awaiting scripts.

public ValueTask<BowireScriptResult> RunPreRequestAsync(BowireScriptCall script, CancellationToken ct = default)

Parameters

script BowireScriptCall
ct CancellationToken

Returns

ValueTask<BowireScriptResult>