Class JSToIntegerThrowOnInfinityNode

java.lang.Object
com.oracle.truffle.api.nodes.Node
com.oracle.truffle.js.nodes.JavaScriptBaseNode
com.oracle.truffle.js.nodes.cast.JSToIntegerThrowOnInfinityNode
All Implemented Interfaces:
com.oracle.truffle.api.nodes.NodeInterface, Cloneable

public abstract class JSToIntegerThrowOnInfinityNode extends JavaScriptBaseNode
This implements ToIntegerThrowOnInfinity (via Temporal proposal).
  • Constructor Details

    • JSToIntegerThrowOnInfinityNode

      public JSToIntegerThrowOnInfinityNode()
  • Method Details

    • execute

      public abstract Object execute(Object value)
    • executeIntOrThrow

      public final int executeIntOrThrow(Object value)
      The node by definition should return a double value (that has integer properties), but in some cases we know that the result needs to fit into an integer. Methods like https://tc39.es/proposal-temporal/#sec-temporal-isodatetimewithinlimits or https://tc39.es/proposal-temporal/#sec-temporal-isoyearmonthwithinlimits ensure that days and months are in valid ranges, and years up to about 273,000 years.
    • executeDouble

      public final double executeDouble(Object value)
    • create

      public static JSToIntegerThrowOnInfinityNode create()
    • doInteger

      protected static int doInteger(int value)
    • doLong

      protected static long doLong(long value)
    • doBoolean

      protected static int doBoolean(boolean value)
    • doSafeInteger

      protected static SafeInteger doSafeInteger(SafeInteger value)
    • doDoubleInfinite

      protected long doDoubleInfinite(double value)
    • doNull

      protected static int doNull(Object value)
    • doUndefined

      protected static int doUndefined(Object value)
    • doSymbol

      protected final Number doSymbol(Symbol value)
    • doBigInt

      protected final Number doBigInt(BigInt value)
    • doString

      protected Number doString(com.oracle.truffle.api.strings.TruffleString value, JSToIntegerThrowOnInfinityNode toIntOrInf, JSStringToNumberNode stringToNumberNode)
    • doJSOrForeignObject

      protected Number doJSOrForeignObject(Object value, JSToIntegerThrowOnInfinityNode toIntOrInf, JSToNumberNode toNumberNode)