Class JSFunctionObject

All Implemented Interfaces:
com.oracle.truffle.api.interop.TruffleObject
Direct Known Subclasses:
JSFunctionObject.BoundOrWrapped, JSFunctionObject.Unbound

public abstract class JSFunctionObject extends JSNonProxyObject
  • Constructor Details

    • JSFunctionObject

      protected JSFunctionObject(com.oracle.truffle.api.object.Shape shape, JSDynamicObject proto, JSFunctionData functionData, com.oracle.truffle.api.frame.MaterializedFrame enclosingFrame, JSRealm realm, Object classPrototype)
  • Method Details

    • getFunctionData

      public final JSFunctionData getFunctionData()
    • getEnclosingFrame

      public final com.oracle.truffle.api.frame.MaterializedFrame getEnclosingFrame()
    • getRealm

      public final JSRealm getRealm()
    • getClassPrototype

      public final Object getClassPrototype()
    • setClassPrototype

      public void setClassPrototype(Object classPrototype)
    • getLexicalThis

      public Object getLexicalThis()
    • getClassName

      public final com.oracle.truffle.api.strings.TruffleString getClassName()
      Description copied from class: JSDynamicObject
      The [[Class]] internal property. For ES5, this is the second part of what Object.prototype.toString.call(myObj) returns, e.g. "[object Array]".
      Overrides:
      getClassName in class JSNonProxyObject
    • getBuiltinToStringTag

      public final com.oracle.truffle.api.strings.TruffleString getBuiltinToStringTag()
      Description copied from class: JSObject
      Returns builtinTag as per Object.prototype.toString(). By default returns "Object".
      Overrides:
      getBuiltinToStringTag in class JSObject
      Returns:
      built-in toStringTag
    • isExecutable

      public final boolean isExecutable(IsCallableNode isCallable)
    • execute

      public final Object execute(Object[] args, com.oracle.truffle.api.interop.InteropLibrary self, JSInteropExecuteNode callNode, ExportValueNode exportNode) throws com.oracle.truffle.api.interop.UnsupportedMessageException
      Throws:
      com.oracle.truffle.api.interop.UnsupportedMessageException
    • isInstantiable

      public final boolean isInstantiable()
    • instantiate

      public final Object instantiate(Object[] args, com.oracle.truffle.api.interop.InteropLibrary self, JSInteropInstantiateNode callNode, ExportValueNode exportNode) throws com.oracle.truffle.api.interop.UnsupportedMessageException
      Throws:
      com.oracle.truffle.api.interop.UnsupportedMessageException
    • hasSourceLocation

      public final boolean hasSourceLocation()
    • getSourceLocation

      public final com.oracle.truffle.api.source.SourceSection getSourceLocation() throws com.oracle.truffle.api.interop.UnsupportedMessageException
      Throws:
      com.oracle.truffle.api.interop.UnsupportedMessageException
    • isMetaObject

      public final boolean isMetaObject()
    • getMetaObjectName

      public final Object getMetaObjectName()
    • isMetaInstance

      public final boolean isMetaInstance(Object instance)
    • toDisplayStringImpl

      public com.oracle.truffle.api.strings.TruffleString toDisplayStringImpl(boolean allowSideEffects, ToDisplayStringFormat format, int depth)
      Description copied from class: JSDynamicObject
      A more informative toString variant, mainly used for error messages.
      Overrides:
      toDisplayStringImpl in class JSNonProxyObject
      Parameters:
      format - formatting parameters
      depth - current nesting depth
    • create

      public static JSFunctionObject create(com.oracle.truffle.api.object.Shape shape, JSDynamicObject proto, JSFunctionData functionData, com.oracle.truffle.api.frame.MaterializedFrame enclosingFrame, JSRealm realm, Object classPrototype)
    • createBound

      public static JSFunctionObject createBound(com.oracle.truffle.api.object.Shape shape, JSDynamicObject proto, JSFunctionData functionData, JSRealm realm, Object classPrototype, Object boundTargetFunction, Object boundThis, Object[] boundArguments)
    • createWrapped

      public static JSFunctionObject createWrapped(com.oracle.truffle.api.object.Shape shape, JSDynamicObject proto, JSFunctionData functionData, JSRealm realm, Object boundTargetFunction)