IWebIdlHost Interface

The services the WebIDL bindings need from the script engine that uses them: error reporting, and the bookkeeping of the JavaScript execution context stack around the callbacks.

public interface IWebIdlHost

Properties

NameDescription
IsScriptRunningGets whether JavaScript code is running (the JavaScript execution context stack is not empty): the current realm of the engine is then the realm of the running code. The default is false.

IsScriptRunning

WebIdlAgent.cs

Gets whether JavaScript code is running (the JavaScript execution context stack is not empty): the current realm of the engine is then the realm of the running code. The default is false.

public bool IsScriptRunning { get; }

Property value

bool

Methods

NameDescription
CheckInterrupt()Called periodically while WebAssembly code runs: throws when the running script must be interrupted (e.g. the timeout of the engine). The default does nothing.
OnCallbackInvoked(GlobalScope)Called after a callback is invoked ("clean up after running a callback", https://webidl.spec.whatwg.org/#clean-up-after-running-a-callback): the engine performs a microtask checkpoint when no script is running.
OnCallbackInvoking()Called before a callback is invoked: the JavaScript execution context stack is not empty until IWebIdlHost.OnCallbackInvoked.
ReportException(GlobalScope, Exception)Reports an exception thrown by a callback (e.g. an event listener) to the global object of a realm (https://html.spec.whatwg.org/multipage/webappapis.html#report-an-exception).

CheckInterrupt()

WebIdlAgent.cs

Called periodically while WebAssembly code runs: throws when the running script must be interrupted (e.g. the timeout of the engine). The default does nothing.

public void CheckInterrupt()

OnCallbackInvoked(GlobalScope)

Called after a callback is invoked ("clean up after running a callback", https://webidl.spec.whatwg.org/#clean-up-after-running-a-callback): the engine performs a microtask checkpoint when no script is running.

void OnCallbackInvoked(GlobalScope global)

Parameters

global GlobalScope

OnCallbackInvoking()

Called before a callback is invoked: the JavaScript execution context stack is not empty until IWebIdlHost.OnCallbackInvoked.

void OnCallbackInvoking()

ReportException(GlobalScope, Exception)

Reports an exception thrown by a callback (e.g. an event listener) to the global object of a realm (https://html.spec.whatwg.org/multipage/webappapis.html#report-an-exception).

void ReportException(GlobalScope global, Exception exception)

Parameters

global GlobalScope
exception Exception