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() @HotSpotIntrinsicCandidate()
  6. def createContext(): ScriptContext
    Definition Classes
    VM
  7. def createContext(sandbox: Object, options: CreateContextOptions = js.native): ScriptContext

    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

  8. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  9. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  10. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  11. def hasOwnProperty(v: String): Boolean
    Definition Classes
    Object
  12. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  13. 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
  14. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  15. def isPrototypeOf(v: Object): Boolean
    Definition Classes
    Object
  16. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  17. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  18. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  19. def propertyIsEnumerable(v: String): Boolean
    Definition Classes
    Object
  20. def runInContext(code: String, contextifiedSandbox: ScriptContext, options: VMRunInContextOptions = js.native): 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])

  21. def runInNewContext(code: String, sandbox: Any, options: VMRunInNewContextOptions = js.native): 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])

  22. def runInThisContext(code: String, options: VMRunInContextOptions = js.native): 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])

  23. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  24. def toLocaleString(): String
    Definition Classes
    Object
  25. def toString(): String
    Definition Classes
    AnyRef → Any
  26. def valueOf(): Any
    Definition Classes
    Object
  27. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  28. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  29. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated @deprecated
    Deprecated

    (Since version ) see corresponding Javadoc for more information.

Inherited from VM

Inherited from Object

Inherited from Any

Inherited from AnyRef

Inherited from Any

Ungrouped