Documentation/WorkerGlobalScope
classWORKER

WorkerGlobalScope

js/worker.js:896

Global object available inside every JSplitter Worker.

propertyWORKERreadonly

name

js/worker.js:912
name: string = ""

Immutable Worker identity supplied through the Worker constructor. The value is fixed for the Worker's lifetime. JSplitter reports the same name in window.JsMemoryStats and in unhandled Worker exception diagnostics. If no name was supplied this value is an empty string; diagnostics display it as <unnamed>.

propertyWORKER

onerror

js/worker.js:953
onerror: ?WorkerErrorCallback = null

Global error handler for uncaught Worker task exceptions. The callback receives an ErrorEvent with the error text and Worker source location. When this handler or a Worker-global error listener is installed, the error is handled locally and is not forwarded to the parent Worker.

propertyWORKER

onmessage

js/worker.js:938
onmessage: ?WorkerMessageCallback = null

Receives messages sent by the parent through Worker.postMessage().

propertyWORKER

onmessageerror

js/worker.js:945
onmessageerror: ?WorkerMessageCallback = null

Receives a MessageEvent when a serialized parent message cannot be reconstructed by the Worker. errorMessage contains the reconstruction failure and direction is panel-to-worker.

propertyWORKER

onrejectionhandled

js/worker.js:967
onrejectionhandled: ?WorkerPromiseRejectionCallback = null

Handler for Promise rejections that later become handled.

propertyWORKER

onunhandledrejection

js/worker.js:960
onunhandledrejection: ?WorkerPromiseRejectionCallback = null

Handler for newly unhandled Promise rejections.

propertyWORKERreadonly

performance

js/worker.js:974
performance: Object

Worker-local performance timeline.

propertyWORKERreadonly

self

js/worker.js:904
self: WorkerGlobalScope

The Worker global object itself.

methodWORKER

close

js/worker.js:930
close()

Requests Worker shutdown from inside the Worker after the current task completes. Use this when Worker code itself knows that no more event-loop work is needed.

methodWORKER

postMessage

js/worker.js:921
postMessage(data, transfer)

Serializes and sends a value from the Worker to its parent.

Parameters

NameTypeDescription
data*

Value to send.

transferoptional(Array<*>|Object)

Transfer list, either directly as an array or as an object containing { transfer: [...] }.