Class ValueLibrary

java.lang.Object
com.oracle.truffle.api.nodes.Node
com.oracle.truffle.api.library.Library
com.oracle.truffle.js.api.ValueLibrary
All Implemented Interfaces:
com.oracle.truffle.api.nodes.NodeInterface, Cloneable

public abstract class ValueLibrary extends com.oracle.truffle.api.library.Library
Value library provides basic operations that are common to all JavaScript values (like ToString() and ToNumber() operations). It also provides basic value type information.
  • Nested Class Summary

    Nested classes/interfaces inherited from class com.oracle.truffle.api.nodes.Node

    com.oracle.truffle.api.nodes.Node.Child, com.oracle.truffle.api.nodes.Node.Children
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static com.oracle.truffle.api.library.LibraryFactory<ValueLibrary>
    Returns the library factory for the value library.
    Returns the uncached automatically dispatched version of the value library.
    boolean
    Returns true if the value is JavaScript ArrayBuffer, returns false otherwise.
    boolean
    Returns true if the value is JavaScript Promise, returns false otherwise.
    boolean
    isProxy(Object value)
    Returns true if the value is JavaScript Proxy, returns false otherwise.
    boolean
    Performs ToBoolean() operation on the given value.
    Performs ToNumber() operation on the given value.
    com.oracle.truffle.api.strings.TruffleString
    Performs ToString() operation on the given value.

    Methods inherited from class com.oracle.truffle.api.library.Library

    accepts

    Methods inherited from class com.oracle.truffle.api.nodes.Node

    accept, adoptChildren, atomic, atomic, copy, deepCopy, getChildren, getCost, getDebugProperties, getDescription, getEncapsulatingSourceSection, getLock, getParent, getRootNode, getSourceSection, insert, insert, isAdoptable, isSafelyReplaceableBy, notifyInserted, onReplace, replace, replace, reportPolymorphicSpecialize, reportReplace, toString

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • ValueLibrary

      public ValueLibrary()
  • Method Details

    • getFactory

      public static com.oracle.truffle.api.library.LibraryFactory<ValueLibrary> getFactory()
      Returns the library factory for the value library.
    • getUncached

      public static ValueLibrary getUncached()
      Returns the uncached automatically dispatched version of the value library.
    • isProxy

      public boolean isProxy(Object value)
      Returns true if the value is JavaScript Proxy, returns false otherwise.
    • isPromise

      public boolean isPromise(Object value)
      Returns true if the value is JavaScript Promise, returns false otherwise.
    • isArrayBuffer

      public boolean isArrayBuffer(Object value)
      Returns true if the value is JavaScript ArrayBuffer, returns false otherwise.
    • toString

      public com.oracle.truffle.api.strings.TruffleString toString(Object value)
      Performs ToString() operation on the given value.
    • toNumber

      public Number toNumber(Object value)
      Performs ToNumber() operation on the given value.
    • toBoolean

      public boolean toBoolean(Object value)
      Performs ToBoolean() operation on the given value.