Packages

object VM extends Object with VM

Virtual Machine Singleton

Annotations
@native() @JSImport("vm", JSImport.Namespace)
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. VM
  2. VM
  3. Object
  4. Any
  5. AnyRef
  6. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  6. def compileFunction(code: String): Function
    Definition Classes
    VM
  7. def compileFunction(code: String, params: Array[String]): Function
    Definition Classes
    VM
  8. def compileFunction(code: String, params: Array[String], options: CompileFunctionOptions): Function
    Definition Classes
    VM
  9. def createContext(): Context
    Definition Classes
    VM
  10. def createContext(sandbox: Object): Context
    Definition Classes
    VM
  11. def createContext(sandbox: Object, options: CreateContextOptions): Context

    If given a sandbox object, the vm.createContext() method will [prepare that sandbox][#vm_what_does_it_mean_to_contextify_an_object] so that it can be used in calls to vm.runInContext() or script.runInContext().

    If given a sandbox object, the vm.createContext() method will [prepare that sandbox][#vm_what_does_it_mean_to_contextify_an_object] so that it can be used in calls to vm.runInContext() or script.runInContext(). Inside such scripts, the sandbox object will be the global object, retaining all of its existing properties but also having the built-in objects and functions any standard global object has. Outside of scripts run by the vm module, sandbox will remain unchanged.

    If sandbox is omitted (or passed explicitly as undefined), a new, empty contextified sandbox object will be returned.

    The vm.createContext() method is primarily useful for creating a single sandbox that can be used to run multiple scripts. For instance, if emulating a web browser, the method can be used to create a single sandbox representing a window's global object, then run all <script> tags together within the context of that sandbox.

    sandbox

    the given sandbox

    Definition Classes
    VM
    Example:
    1. vm.createContext([sandbox])

    Since

    0.11.7

  12. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  13. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  14. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  15. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  16. def hasOwnProperty(v: String): Boolean
    Definition Classes
    Object
  17. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  18. def isContext(sandbox: Object): Boolean

    Returns true if the given sandbox object has been contextified using vm.createContext().

    Returns true if the given sandbox object has been contextified using vm.createContext().

    sandbox

    the sandbox

    returns

    true if the given sandbox object has been contextified using vm.createContext().

    Definition Classes
    VM
  19. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  20. def isPrototypeOf(v: Object): Boolean
    Definition Classes
    Object
  21. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  22. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  23. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  24. def propertyIsEnumerable(v: String): Boolean
    Definition Classes
    Object
  25. def runInContext(code: String, contextifiedSandbox: Context): Any
    Definition Classes
    VM
  26. def runInContext(code: String, contextifiedSandbox: Context, options: VMRunInContextOptions): Any

    Runs the compiled code contained by the vm.Script object within the given contextifiedSandbox and returns the result.

    Runs the compiled code contained by the vm.Script object within the given contextifiedSandbox and returns the result. Running code does not have access to local scope.

    code

    The JavaScript code to compile and run.

    contextifiedSandbox

    A contextified object as returned by the vm.createContext() method.

    options

    the optional options

    Definition Classes
    VM
    Example:
    1. script.runInContext(contextifiedSandbox[, options])

  27. def runInNewContext(code: String, sandbox: Any): Any
    Definition Classes
    VM
  28. def runInNewContext(code: String, sandbox: Any, options: VMRunInNewContextOptions): Any

    First contextifies the given sandbox, runs the compiled code contained by the vm.Script object within the created sandbox, and returns the result.

    First contextifies the given sandbox, runs the compiled code contained by the vm.Script object within the created sandbox, and returns the result. Running code does not have access to local scope.

    code

    The JavaScript code to compile and run.

    sandbox

    An object that will be contextified. If undefined, a new object will be created.

    options

    the optional options

    Definition Classes
    VM
    Example:
    1. vm.runInNewContext(code[, sandbox][, options])

  29. def runInThisContext(code: String): Script
    Definition Classes
    VM
  30. def runInThisContext(code: String, options: VMRunInContextOptions): Script

    Runs the compiled code contained by the vm.Script within the context of the current global object.

    Runs the compiled code contained by the vm.Script within the context of the current global object. Running code does not have access to local scope, but does have access to the current global object.

    code

    The JavaScript code to compile and run.

    options

    the optional options

    Definition Classes
    VM
    Example:
    1. script.runInThisContext([options])

  31. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  32. def toLocaleString(): String
    Definition Classes
    Object
  33. def toString(): String
    Definition Classes
    AnyRef → Any
  34. def valueOf(): Any
    Definition Classes
    Object
  35. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  36. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  37. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()

Inherited from VM

Inherited from Object

Inherited from Any

Inherited from AnyRef

Inherited from Any

Ungrouped