Class CommonJSRequireBuiltin

All Implemented Interfaces:
com.oracle.truffle.api.instrumentation.InstrumentableNode, com.oracle.truffle.api.nodes.NodeInterface, Cloneable

public abstract class CommonJSRequireBuiltin extends GlobalBuiltins.JSFileLoadingOperation
  • Field Details

    • UNSUPPORTED_NODE_FILE

      public static final String UNSUPPORTED_NODE_FILE
      See Also:
    • MODULE_SOURCE_KEY

      public static final com.oracle.truffle.api.object.HiddenKey MODULE_SOURCE_KEY
      Used to store the Source of a CJS module in its module object.
  • Method Details

    • log

      public static void log(Object... message)
    • require

      protected Object require(JSDynamicObject currentRequire, com.oracle.truffle.api.strings.TruffleString moduleIdentifier)
    • fallback

      protected static Object fallback(Object function, Object moduleIdentifier)
    • isCallerSensitive

      public boolean isCallerSensitive()
      Description copied from class: JSBuiltinNode
      If true, this function needs the call source location. The call node uses this hint to try and pass the call node via a thread-local field (in the case of a direct call) that the built-in can then use to avoid an expensive stack walk.
      Overrides:
      isCallerSensitive in class JSBuiltinNode
    • toString1

      protected final com.oracle.truffle.api.strings.TruffleString toString1(Object target)