Class Context

The Context class to execute a script.

Hierarchy

  • Context

Constructors

Properties

Accessors

Methods

Constructors

Properties

name: string

The context name.

Accessors

  • get globalThis(): object
  • The globalThis object for this context. Deeply equals to sandbox in constructor.

    Returns object

Methods

  • Execute a script and return it's last statement's result.

    Returns

    The last statement's result of the script.

    Parameters

    • script: string | Script

      The script string or script object to be executed.

    • Optional options: ExecuteOptions

      The script options.

    Returns any

Generated using TypeDoc