KiteJsConfig

How to build an engine. Everything has a working default.

Properties

Link copied to clipboard

Whether a function whose body starts with "use asm" is compiled ahead of time to typed code. On by default.

Link copied to clipboard
var clock: () -> Double?

Where Date.now() reads the time from, in epoch milliseconds. Fix it to make tests stable.

Link copied to clipboard

Where console.log and its neighbours go. Null leaves console out of the global scope.

Link copied to clipboard

How many interpreter instructions one call may run before the engine gives up. Zero, the default, means no limit. This is how you stop a script that never returns.

Link copied to clipboard

Asked now and then while a script runs. Answer true, or throw, to stop it. This is how an outside signal reaches a running script: a deadline, a cancelled coroutine, a stop button. Setting it turns the instruction observer on even without a budget.

Link copied to clipboard

Which JavaScript the engine speaks.

Link copied to clipboard

The byte order a typed array view uses, for example Int32Array over an ArrayBuffer. Little-endian is what every browser and Node answer, and what Emscripten output needs. Set it to false only for a script written against Rhino's old order. DataView is unaffected: it takes the order on every call.

Link copied to clipboard

Leaves out the built-ins a sandbox does not want. Today that is only the old Packages hooks.

Link copied to clipboard

Makes the built-ins read-only, so a script cannot redefine Array.prototype.push.

Link copied to clipboard
var timeZone: TimeZone

The zone Date reads local time in.