Trait/Object

io.scalajs.nodejs.vm

VM

Related Docs: object VM | package vm

Permalink

trait VM extends Object

The vm module provides APIs for compiling and running code within V8 Virtual Machine contexts.

Annotations
@RawJSType() @native()
See also

https://nodejs.org/api/vm.html

Linear Supertypes
Object, Any, AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. VM
  2. Object
  3. Any
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. def createContext(sandbox: Any): ScriptContext

    Permalink

    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

    Example:
    1. vm.createContext([sandbox])

    Since

    0.11.7

  7. def createScript(code: String, options: |[ScriptOptions, RawOptions] = js.native): ContextifyScript

    Permalink

    Creates a new script

    Creates a new script

    code

    The JavaScript code to compile.

    options

    the optional options

    Example:
    1. vm.createScript(code[, options])

  8. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  9. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  10. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  11. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  12. def hasOwnProperty(v: String): Boolean

    Permalink
    Definition Classes
    Object
  13. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  14. def isContext(sandbox: Any): Boolean

    Permalink

    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().

  15. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  16. def isPrototypeOf(v: Object): Boolean

    Permalink
    Definition Classes
    Object
  17. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  18. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  19. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  20. def propertyIsEnumerable(v: String): Boolean

    Permalink
    Definition Classes
    Object
  21. def runInContext(code: String, contextifiedSandbox: ScriptContext, options: |[ContextOptions, RawOptions] = js.native): Any

    Permalink

    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

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

  22. def runInDebugContext(code: String): Any

    Permalink

    The vm.runInDebugContext() method compiles and executes code inside the V8 debug context.

    The vm.runInDebugContext() method compiles and executes code inside the V8 debug context.

    code

    The JavaScript code to compile and run.

    Example:
    1. vm.runInDebugContext(code)

  23. def runInNewContext(code: String, sandbox: Any, options: |[ContextOptions, RawOptions] = js.native): Any

    Permalink

    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

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

  24. def runInThisContext(code: String, options: |[ContextOptions, RawOptions] = js.native): ContextifyScript

    Permalink

    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

    Example:
    1. script.runInThisContext([options])

  25. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  26. def toLocaleString(): String

    Permalink
    Definition Classes
    Object
  27. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  28. def valueOf(): Any

    Permalink
    Definition Classes
    Object
  29. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  30. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  31. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Object

Inherited from Any

Inherited from AnyRef

Inherited from Any

Ungrouped