ContextFactory

open class ContextFactory

Makes Context objects and answers the questions a context asks about its environment: which optional behaviours are on, and what wraps a top-level call.

An embedder subclasses this to change those answers. Upstream also hangs class loaders and thread-safety defaults here; neither exists in this port.

Constructors

Link copied to clipboard
constructor()

Types

Link copied to clipboard
object Companion
Link copied to clipboard
interface Listener

Told when a context is made and when it is released.

Properties

Link copied to clipboard

Functions

Link copied to clipboard
Link copied to clipboard
fun <T> call(action: ContextAction<T>): T

Runs action with a context entered, entering one if none is.

Link copied to clipboard
open fun doTopCall(script: Script, cx: Context, scope: Scriptable, thisObj: Scriptable): Any?

open fun doTopCall(callable: Callable, cx: Context, scope: Scriptable, thisObj: Scriptable?, args: Array<Any?>): Any?

Wraps every top-level call. The default flattens a lazy string result.

Link copied to clipboard
Link copied to clipboard
open fun hasFeature(cx: Context, featureIndex: Int): Boolean

Whether an optional engine behaviour is on. These are the defaults; a subclass changes them by overriding this. Thread-safe objects are always off (D-3).

Link copied to clipboard
open fun observeInstructionCount(cx: Context, instructionCount: Int)

Called every time the interpreter has run instructionCount more instructions.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun seal()