public final class JSRuntime extends Object
| Modifier and Type | Field and Description |
|---|---|
static com.oracle.truffle.api.strings.TruffleString |
DONE |
static com.oracle.truffle.api.object.HiddenKey |
ENUMERATE_ITERATOR_ID |
static long |
INVALID_ARRAY_INDEX |
static long |
INVALID_INTEGER_INDEX |
static long |
INVALID_SAFE_INTEGER |
static int |
ITERATION_KIND_KEY |
static int |
ITERATION_KIND_KEY_PLUS_VALUE |
static int |
ITERATION_KIND_VALUE |
static long |
MAX_ARRAY_LENGTH |
static long |
MAX_BIG_INT_EXPONENT |
static int |
MAX_INTEGER_INDEX_DIGITS |
static double |
MAX_SAFE_INTEGER |
static int |
MAX_SAFE_INTEGER_DIGITS |
static int |
MAX_SAFE_INTEGER_IN_FLOAT |
static long |
MAX_SAFE_INTEGER_LONG |
static int |
MAX_UINT32_DIGITS |
static double |
MIN_SAFE_INTEGER |
static int |
MIN_SAFE_INTEGER_IN_FLOAT |
static long |
MIN_SAFE_INTEGER_LONG |
static com.oracle.truffle.api.strings.TruffleString |
NEXT |
static double |
TWO32 |
static com.oracle.truffle.api.strings.TruffleString |
VALUE |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
arrayIndexLengthInRange(com.oracle.truffle.api.strings.TruffleString indexStr) |
static int |
booleanToNumber(boolean value) |
static com.oracle.truffle.api.strings.TruffleString |
booleanToString(boolean value) |
static Object |
call(Object fnObj,
Object holder,
Object[] arguments)
ES2015 7.3.12 Call(F, V, arguments).
|
static Object |
call(Object fnObj,
Object holder,
Object[] arguments,
com.oracle.truffle.api.nodes.Node encapsulatingNode) |
static Object |
canonicalNumericIndexString(com.oracle.truffle.api.strings.TruffleString s)
ES2015, 7.1.16 CanonicalNumericIndexString().
|
static long |
castArrayIndex(double doubleValue) |
static long |
castArrayIndex(long longValue) |
static com.oracle.truffle.api.strings.TruffleString |
collectionToConsoleString(JSDynamicObject obj,
boolean allowSideEffects,
ToDisplayStringFormat format,
com.oracle.truffle.api.strings.TruffleString name,
JSHashMap map,
int depth) |
static int |
comparePropertyKeys(Object key1,
Object key2)
Compare property keys such that a stable sort using it would maintain the following order.
|
static Object |
construct(Object fnObj,
Object[] arguments) |
static JSDynamicObject |
createArrayFromList(JSContext context,
JSRealm realm,
List<? extends Object> list)
ES2016 7.3.16 CreateArrayFromList(elements).
|
static boolean |
createDataProperty(JSDynamicObject o,
Object p,
Object v)
ES2015, 7.3.4 CreateDataProperty(O, P, V).
|
static boolean |
createDataProperty(JSDynamicObject o,
Object p,
Object v,
boolean doThrow) |
static boolean |
createDataPropertyOrThrow(JSDynamicObject o,
Object p,
Object v)
ES2015, 7.3.6 CreateDataPropertyOrThrow(O, P, V).
|
static List<Object> |
createListFromArrayLikeAllowSymbolString(Object obj) |
static void |
createNonEnumerableDataPropertyOrThrow(JSDynamicObject o,
Object p,
Object v)
Error Cause 7.3.6 CreateNonEnumerableDataPropertyOrThrow(O, P, V).
|
static void |
definePropertyOrThrow(JSDynamicObject o,
Object key,
PropertyDescriptor desc)
ES2016, 7.3.7 DefinePropertyOrThrow(O, P, desc).
|
static boolean |
doubleIsRepresentableAsInt(double d) |
static boolean |
doubleIsRepresentableAsInt(double d,
boolean ignoreNegativeZero) |
static boolean |
doubleIsRepresentableAsLong(double d) |
static boolean |
doubleIsRepresentableAsUnsignedInt(double d,
boolean ignoreNegativeZero) |
static Number |
doubleToNarrowestNumber(double d) |
static com.oracle.truffle.api.strings.TruffleString |
doubleToString(double d)
9.8.1 ToString Applied to the Number Type.
|
static Object |
doubleToString(double d,
int radix) |
static double |
doubleValue(Number number) |
static double |
doubleValue(Number number,
com.oracle.truffle.api.profiles.BranchProfile profile) |
static double |
doubleValueVirtual(Number number) |
static boolean |
equal(Object a,
Object b) |
static JSDynamicObject |
expectJSObject(Object to,
com.oracle.truffle.api.profiles.BranchProfile errorBranch) |
static Object |
exportValue(Object value)
Convert the value to a type valid in Truffle Interop.
|
static Object[] |
exportValueArray(Object[] arr) |
static List<Object> |
filterPrivateSymbols(List<Object> list) |
static int |
firstExpIndexInString(com.oracle.truffle.api.strings.TruffleString str)
Returns the first index of a String that contains either 'e' or 'E'.
|
static int |
firstNonWhitespaceIndex(com.oracle.truffle.api.strings.TruffleString string,
com.oracle.truffle.api.strings.TruffleString.ReadCharUTF16Node charAtNode) |
static float |
floatValue(Number n) |
static float |
floatValueVirtual(Number n) |
static int |
floorMod(long x,
int y) |
static String |
formatDtoA(double value) |
static Object |
formatDtoA(double d,
int radix) |
static Object |
formatDtoAExponential(double d) |
static Object |
formatDtoAExponential(double d,
int digits) |
static Object |
formatDtoAFixed(double value,
int digits) |
static Object |
formatDtoAPrecision(double value,
int precision) |
static JSDynamicObject |
fromPropertyDescriptor(PropertyDescriptor desc,
JSContext context) |
static Object |
get(Object obj,
long index) |
static Object |
get(Object obj,
Object key) |
static Object |
getArg(Object[] args,
int i,
Object defaultValue) |
static Object |
getArgOrUndefined(Object[] args,
int i) |
static Object |
getBufferElementDirect(ByteBufferAccess bufferAccess,
ByteBuffer buffer,
TypedArray.ElementType elementType,
int index) |
static com.oracle.truffle.api.strings.TruffleString |
getConstructorName(JSDynamicObject receiver)
Carefully try getting the constructor name, must not throw.
|
static Object |
getDataProperty(JSDynamicObject thisObj,
Object key) |
static GraalJSException |
getException(Object errorObject) |
static JSRealm |
getFunctionRealm(Object obj,
JSRealm currentRealm) |
static IteratorRecord |
getIterator(Object iteratedObject) |
static int |
getOffset(int start,
int length,
com.oracle.truffle.api.nodes.Node node,
com.oracle.truffle.api.profiles.InlinedConditionProfile profile) |
static long |
getOffset(long start,
long length,
com.oracle.truffle.api.nodes.Node node,
com.oracle.truffle.api.profiles.InlinedConditionProfile profile) |
static boolean |
hasProperty(Object obj,
Object key) |
static boolean |
identical(Object a,
Object b) |
static double |
identifyInfinity(char firstChar,
int len) |
static Object |
importValue(Object value)
Convert the value to a type valid in Graal.js, from something received via TruffleInterop.
|
static boolean |
intIsRepresentableAsFloat(int value) |
static int |
intValue(Number number) |
static int |
intValueVirtual(Number number) |
static boolean |
isArray(Object obj)
ES2015 7.2.2 IsArray(argument).
|
static boolean |
isArrayIndex(double doubleValue) |
static boolean |
isArrayIndex(int intValue) |
static boolean |
isArrayIndex(long longValue) |
static boolean |
isArrayIndex(Object property) |
static boolean |
isArrayIndexString(com.oracle.truffle.api.strings.TruffleString property) |
static boolean |
isAsciiDigit(int c) |
static boolean |
isBigInt(Object value) |
static boolean |
isCallable(Object value)
ES2015 7.2.3 IsCallable(argument).
|
static boolean |
isCallableForeign(Object value) |
static boolean |
isCallableIsJSObject(JSDynamicObject value) |
static boolean |
isCallableProxy(JSDynamicObject proxy) |
static boolean |
isConstructor(Object constrObj)
ES2016 7.2.4 IsConstructor().
|
static boolean |
isConstructorForeign(Object value) |
static boolean |
isConstructorProxy(JSDynamicObject constrObj) |
static boolean |
isForeignObject(Object value) |
static boolean |
isForeignObject(com.oracle.truffle.api.interop.TruffleObject value) |
static boolean |
isGenerator(Object genObj) |
static boolean |
isGeneratorProxy(JSDynamicObject genObj) |
static boolean |
isHex(char c) |
static boolean |
isInteger(Object obj)
ES2015, 7.2.6 IsInteger.
|
static boolean |
isIntegerIndex(long longValue) |
static boolean |
isIntegralNumber(double arg) |
static boolean |
isJavaNumber(Object value) |
static boolean |
isJavaPrimitive(Object value) |
static boolean |
isJSFunctionRootNode(com.oracle.truffle.api.nodes.RootNode rootNode) |
static boolean |
isJSNative(Object value)
Is value a native JavaScript object or primitive?
|
static boolean |
isJSPrimitive(Object value) |
static boolean |
isJSRootNode(com.oracle.truffle.api.nodes.RootNode rootNode) |
static boolean |
isLineTerminator(char codePoint) |
static boolean |
isNaN(Object value) |
static boolean |
isNegativeZero(double d) |
static boolean |
isNullish(Object value)
Returns whether
value is JS null or undefined or a foreign null. |
static boolean |
isNullOrUndefined(Object value)
Returns whether
value is JS null or undefined. |
static boolean |
isNumber(Object value) |
static boolean |
isObject(Object value)
Returns whether object is a JSObject.
|
static boolean |
isPositiveInfinity(double d) |
static boolean |
isPrivateSymbol(Object key) |
static boolean |
isPropertyKey(Object key) |
static boolean |
isPrototypeOf(JSDynamicObject object,
JSDynamicObject prototype) |
static boolean |
isProxyAnArray(JSDynamicObject proxy) |
static boolean |
isRepresentableAsUnsignedInt(long value) |
static boolean |
isSafeInteger(double value) |
static boolean |
isSafeInteger(long value) |
static boolean |
isSameValue(Object x,
Object y)
9.12 SameValue Algorithm.
|
static boolean |
isStringClass(Class<?> clazz) |
static boolean |
isValidArrayLength(double doubleValue) |
static boolean |
isValidArrayLength(int intValue) |
static boolean |
isValidArrayLength(long longValue)
Checks whether a long value is within the valid range of array lengths.
|
static boolean |
isWhiteSpaceExcludingLineTerminator(char cp)
WhiteSpace (excluding LineTerminator).
|
static boolean |
isWhiteSpaceOrLineTerminator(char cp)
Union of WhiteSpace and LineTerminator (StrWhiteSpaceChar).
|
static void |
iteratorClose(Object iterator) |
static Object |
iteratorStep(IteratorRecord iteratorRecord) |
static Object |
iteratorValue(Object iterator) |
static String |
javaToString(Object obj) |
static Object |
jsObjectToJavaObject(Object obj) |
static int |
lastNonWhitespaceIndex(com.oracle.truffle.api.strings.TruffleString string,
com.oracle.truffle.api.strings.TruffleString.ReadCharUTF16Node charAtNode) |
static boolean |
longFitsInDouble(long l) |
static boolean |
longIsRepresentableAsInt(long value) |
static Number |
longToIntOrDouble(long value) |
static long |
longValue(Number n) |
static Object |
nullToUndefined(Object value) |
static String |
numberToJavaString(Number number) |
static com.oracle.truffle.api.strings.TruffleString |
numberToString(Number number) |
static com.oracle.truffle.api.strings.TruffleString |
objectToDisplayString(JSDynamicObject obj,
boolean allowSideEffects,
ToDisplayStringFormat format,
int depth,
com.oracle.truffle.api.strings.TruffleString name) |
static com.oracle.truffle.api.strings.TruffleString |
objectToDisplayString(JSDynamicObject obj,
boolean allowSideEffects,
ToDisplayStringFormat format,
int depth,
com.oracle.truffle.api.strings.TruffleString name,
com.oracle.truffle.api.strings.TruffleString[] internalKeys,
Object[] internalValues) |
static long |
parseArrayIndexIsIndexRaw(Object o) |
static long |
parseArrayIndexRaw(com.oracle.truffle.api.strings.TruffleString string,
com.oracle.truffle.api.strings.TruffleString.ReadCharUTF16Node charAtNode)
NB: does not check whether the result fits into the uint32 range.
|
static double |
parseDoubleOrNaN(com.oracle.truffle.api.strings.TruffleString input)
|
static double |
parseRawDontFitLong(com.oracle.truffle.api.strings.TruffleString string,
int radix,
int startPos,
int endPos,
boolean negate) |
static Number |
parseRawFitsLong(com.oracle.truffle.api.strings.TruffleString string,
int radix,
int startPos,
int endPos,
boolean negate) |
static long |
parseSafeInteger(com.oracle.truffle.api.strings.TruffleString s) |
static long |
parseSafeInteger(com.oracle.truffle.api.strings.TruffleString s,
int beginIndex,
int endIndex,
int radix) |
static Object |
positiveLongToIntOrDouble(long value) |
static boolean |
propertyKeyEquals(com.oracle.truffle.api.strings.TruffleString.EqualNode equalsNode,
Object a,
Object b) |
static long |
propertyKeyToArrayIndex(Object propertyKey) |
static com.oracle.truffle.api.strings.TruffleString |
propertyKeyToFunctionNameString(Object key) |
static long |
propertyKeyToIntegerIndex(Object propertyKey) |
static long |
propertyNameToArrayIndex(com.oracle.truffle.api.strings.TruffleString propertyName,
com.oracle.truffle.api.strings.TruffleString.ReadCharUTF16Node charAtNode) |
static long |
propertyNameToIntegerIndex(com.oracle.truffle.api.strings.TruffleString propertyName) |
static String |
quote(String value) |
static com.oracle.truffle.api.strings.TruffleString |
quote(com.oracle.truffle.api.strings.TruffleString value) |
static <T> T |
requireObjectCoercible(T argument)
Implementation of the abstract operation RequireObjectCoercible.
|
static <E extends Throwable> |
rethrow(Throwable ex) |
static com.oracle.truffle.api.strings.TruffleString |
safeToString(Object value) |
static void |
setBufferElementDirect(ByteBufferAccess bufferAccess,
ByteBuffer buffer,
TypedArray.ElementType elementType,
int index,
Object value) |
static String |
stringConcat(String first,
String second)
Concatenate two strings, preallocating the buffer with the exact length of the result.
|
static BigInt |
stringToBigInt(com.oracle.truffle.api.strings.TruffleString s) |
static Number |
stringToNumber(com.oracle.truffle.api.strings.TruffleString string)
Implementation of ECMA 9.3.1 "ToNumber Applied to the String Type".
|
static BigInt |
toBigInt(Object value) |
static boolean |
toBoolean(Number number) |
static boolean |
toBoolean(Object value)
Implementation of ECMA 9.2 "ToBoolean".
|
static com.oracle.truffle.api.strings.TruffleString |
toDisplayString(Object value,
boolean allowSideEffects) |
static com.oracle.truffle.api.strings.TruffleString |
toDisplayString(Object value,
boolean allowSideEffects,
ToDisplayStringFormat format) |
static com.oracle.truffle.api.strings.TruffleString |
toDisplayStringImpl(Object value,
boolean allowSideEffects,
ToDisplayStringFormat format,
int depth,
Object parent)
Converts the value to a String that can be printed on the console and used in error messages.
|
static com.oracle.truffle.api.strings.TruffleString |
toDisplayStringInner(Object value,
boolean allowSideEffects,
ToDisplayStringFormat format,
int currentDepth,
Object parent) |
static double |
toDouble(Number value)
ToDouble for Numbers.
|
static double |
toDouble(Object value)
Non-standard "ToDouble" utility function.
|
static int |
toInt16(long number) |
static int |
toInt16(Number number) |
static int |
toInt16(Object value)
Implementation of ECMA 7.1.7 "ToInt16".
|
static int |
toInt32(double value) |
static int |
toInt32(Number number)
Convert JS number to int32.
|
static int |
toInt32(Object value)
Implementation of ECMA 9.5 "ToInt32".
|
static int |
toInt32NoTruncate(double value) |
static int |
toInt8(long number) |
static int |
toInt8(Number number) |
static int |
toInt8(Object value)
Implementation of ECMA 7.1.9 "ToInt8".
|
static long |
toInteger(Number number) |
static long |
toInteger(Object value)
Implementation of ECMA 9.4 "ToInteger".
|
static Object |
toJavaNull(Object value) |
static String |
toJavaString(Object value) |
static Object |
toJSNull(Object value) |
static double |
toLength(double d) |
static int |
toLength(int value) |
static long |
toLength(long l) |
static long |
toLength(Object value)
Implementation of ECMAScript6 7.1.15 "ToLength".
|
static long |
toLong(Number value)
Convert JS number to long.
|
static Number |
toNumber(Object value)
Implementation of ECMA 9.3 "ToNumber".
|
static Object |
toNumeric(Object value) |
static Object |
toObject(Object value)
Implementation of ECMA 9.9 "ToObject".
|
static Object |
toPrimitive(Object value)
Implementation of ECMA 7.1.1 "ToPrimitive", with NO hint given.
|
static Object |
toPrimitive(Object value,
JSToPrimitiveNode.Hint hint)
Implementation of ECMA 7.1.1 "ToPrimitive".
|
static Object |
toPrimitiveFromForeign(Object tObj,
JSToPrimitiveNode.Hint hint)
Converts a foreign object to a primitive value.
|
static PropertyDescriptor |
toPropertyDescriptor(Object property)
Implementation of the ToPropertyDescriptor function as defined in ECMA 8.10.5.
|
static Object |
toPropertyKey(Object arg)
ES2015 7.1.14 ToPropertyKey(argument).
|
static com.oracle.truffle.api.strings.TruffleString |
toString(JSDynamicObject value) |
static com.oracle.truffle.api.strings.TruffleString |
toString(Object value)
The abstract operation ToString.
|
static com.oracle.truffle.api.strings.TruffleString |
toStringIsString(Object value) |
static int |
toUInt16(long number) |
static int |
toUInt16(Number number) |
static int |
toUInt16(Object value)
Implementation of ECMA 9.7 "ToUInt16".
|
static long |
toUInt32(double value) |
static Number |
toUint32(int value) |
static long |
toUInt32(long value) |
static long |
toUInt32(Number number) |
static long |
toUInt32(Object value)
Implementation of ECMA 9.6 "ToUInt32".
|
static long |
toUInt32NoTruncate(double value) |
static int |
toUInt8(long number) |
static int |
toUInt8(Number number) |
static int |
toUInt8(Object value)
Implementation of ECMA 7.1.10 "ToUInt8".
|
static com.oracle.truffle.api.strings.TruffleString |
trimJSWhiteSpace(com.oracle.truffle.api.strings.TruffleString string) |
static double |
truncateDouble(double value) |
static com.oracle.truffle.api.strings.TruffleString |
typeof(Object value) |
static Object |
undefinedToNull(Object value) |
static int |
valueInHex(char c) |
static int |
valueInRadix(char c,
int radix) |
static int |
valueInRadix10(char c) |
public static final double TWO32
public static final long INVALID_ARRAY_INDEX
public static final long MAX_ARRAY_LENGTH
public static final int MAX_UINT32_DIGITS
public static final double MAX_SAFE_INTEGER
public static final double MIN_SAFE_INTEGER
public static final long MAX_SAFE_INTEGER_LONG
public static final long MIN_SAFE_INTEGER_LONG
public static final long INVALID_INTEGER_INDEX
public static final int MAX_INTEGER_INDEX_DIGITS
public static final int MAX_SAFE_INTEGER_DIGITS
public static final int MAX_SAFE_INTEGER_IN_FLOAT
public static final int MIN_SAFE_INTEGER_IN_FLOAT
public static final long MAX_BIG_INT_EXPONENT
public static final long INVALID_SAFE_INTEGER
public static final com.oracle.truffle.api.strings.TruffleString VALUE
public static final com.oracle.truffle.api.strings.TruffleString DONE
public static final com.oracle.truffle.api.strings.TruffleString NEXT
public static final com.oracle.truffle.api.object.HiddenKey ENUMERATE_ITERATOR_ID
public static final int ITERATION_KIND_KEY
public static final int ITERATION_KIND_VALUE
public static final int ITERATION_KIND_KEY_PLUS_VALUE
public static boolean doubleIsRepresentableAsInt(double d)
public static boolean doubleIsRepresentableAsInt(double d,
boolean ignoreNegativeZero)
public static boolean doubleIsRepresentableAsUnsignedInt(double d,
boolean ignoreNegativeZero)
public static boolean isNegativeZero(double d)
public static boolean isPositiveInfinity(double d)
public static Number doubleToNarrowestNumber(double d)
public static boolean longIsRepresentableAsInt(long value)
public static boolean isRepresentableAsUnsignedInt(long value)
public static boolean doubleIsRepresentableAsLong(double d)
public static Object positiveLongToIntOrDouble(long value)
public static Number longToIntOrDouble(long value)
public static boolean longFitsInDouble(long l)
public static boolean isNaN(Object value)
public static com.oracle.truffle.api.strings.TruffleString typeof(Object value)
public static boolean isObject(Object value)
public static boolean isNullOrUndefined(Object value)
value is JS null or undefined.public static boolean isNullish(Object value)
value is JS null or undefined or a foreign null.public static Object toPrimitive(Object value)
value - an Object to be converted to a primitive valuepublic static Object toPrimitive(Object value, JSToPrimitiveNode.Hint hint)
value - an Object to be converted to a primitive valuehint - the preferred type of primitive to return ("number", "string" or "default")JSToPrimitiveNodepublic static Object toPrimitiveFromForeign(Object tObj, JSToPrimitiveNode.Hint hint)
public static boolean toBoolean(Object value)
value - an Object to be converted to a Booleanpublic static boolean toBoolean(Number number)
public static Number toNumber(Object value)
value - an Object to be converted to a Numberpublic static int booleanToNumber(boolean value)
public static boolean isNumber(Object value)
public static boolean isBigInt(Object value)
public static boolean isJavaNumber(Object value)
public static Number stringToNumber(com.oracle.truffle.api.strings.TruffleString string)
string - public static double parseDoubleOrNaN(com.oracle.truffle.api.strings.TruffleString input)
Double.NaN if not parsable.public static int firstExpIndexInString(com.oracle.truffle.api.strings.TruffleString str)
public static double identifyInfinity(char firstChar,
int len)
public static long toInteger(Object value)
value - an Object to be converted to an Integerpublic static long toInteger(Number number)
public static long toLength(Object value)
public static double toLength(double d)
public static long toLength(long l)
public static int toLength(int value)
public static int toUInt8(Object value)
value - an Object to be converted to a UInt8public static int toUInt8(Number number)
public static int toUInt8(long number)
public static int toInt8(Object value)
value - an Object to be converted to a Int8public static int toInt8(Number number)
public static int toInt8(long number)
public static int toUInt16(Object value)
value - an Object to be converted to a UInt16public static int toUInt16(Number number)
public static int toUInt16(long number)
public static int toInt16(Object value)
value - an Object to be converted to a Int16public static int toInt16(Number number)
public static int toInt16(long number)
public static int floorMod(long x,
int y)
public static long toUInt32(Object value)
value - an Object to be converted to a UInt32public static long toUInt32(Number number)
public static long toUInt32(long value)
public static long toUInt32(double value)
public static long toUInt32NoTruncate(double value)
public static double truncateDouble(double value)
public static int toInt32(Object value)
value - an Object to be converted to a Int32public static int toInt32(Number number)
public static int toInt32(double value)
public static int toInt32NoTruncate(double value)
public static double toDouble(Object value)
public static double toDouble(Number value)
public static com.oracle.truffle.api.strings.TruffleString toString(Object value)
public static com.oracle.truffle.api.strings.TruffleString safeToString(Object value)
public static com.oracle.truffle.api.strings.TruffleString toDisplayString(Object value, boolean allowSideEffects)
public static com.oracle.truffle.api.strings.TruffleString toDisplayString(Object value, boolean allowSideEffects, ToDisplayStringFormat format)
public static com.oracle.truffle.api.strings.TruffleString toDisplayStringInner(Object value, boolean allowSideEffects, ToDisplayStringFormat format, int currentDepth, Object parent)
public static com.oracle.truffle.api.strings.TruffleString toDisplayStringImpl(Object value, boolean allowSideEffects, ToDisplayStringFormat format, int depth, Object parent)
format - formatting parametersdepth - current recursion depth (starts at 0 = top level)parent - parent object or nullpublic static com.oracle.truffle.api.strings.TruffleString objectToDisplayString(JSDynamicObject obj, boolean allowSideEffects, ToDisplayStringFormat format, int depth, com.oracle.truffle.api.strings.TruffleString name)
public static com.oracle.truffle.api.strings.TruffleString objectToDisplayString(JSDynamicObject obj, boolean allowSideEffects, ToDisplayStringFormat format, int depth, com.oracle.truffle.api.strings.TruffleString name, com.oracle.truffle.api.strings.TruffleString[] internalKeys, Object[] internalValues)
public static com.oracle.truffle.api.strings.TruffleString collectionToConsoleString(JSDynamicObject obj, boolean allowSideEffects, ToDisplayStringFormat format, com.oracle.truffle.api.strings.TruffleString name, JSHashMap map, int depth)
public static com.oracle.truffle.api.strings.TruffleString booleanToString(boolean value)
public static com.oracle.truffle.api.strings.TruffleString toString(JSDynamicObject value)
public static com.oracle.truffle.api.strings.TruffleString numberToString(Number number)
public static boolean propertyKeyEquals(com.oracle.truffle.api.strings.TruffleString.EqualNode equalsNode,
Object a,
Object b)
public static Object doubleToString(double d, int radix)
public static com.oracle.truffle.api.strings.TruffleString doubleToString(double d)
Better use JSDoubleToStringNode where appropriate.
public static String formatDtoA(double value)
public static Object formatDtoAPrecision(double value, int precision)
public static Object formatDtoAExponential(double d, int digits)
public static Object formatDtoAExponential(double d)
public static Object formatDtoAFixed(double value, int digits)
public static Object formatDtoA(double d, int radix)
public static Object toObject(Object value)
value - an Object to be converted to an Objectpublic static boolean isForeignObject(Object value)
public static boolean isForeignObject(com.oracle.truffle.api.interop.TruffleObject value)
public static <T> T requireObjectCoercible(T argument)
public static PropertyDescriptor toPropertyDescriptor(Object property)
public static int valueInRadix10(char c)
public static int valueInRadix(char c,
int radix)
public static int valueInHex(char c)
public static boolean isHex(char c)
public static long parseArrayIndexIsIndexRaw(Object o)
public static long parseArrayIndexRaw(com.oracle.truffle.api.strings.TruffleString string,
com.oracle.truffle.api.strings.TruffleString.ReadCharUTF16Node charAtNode)
JSRuntime.isArrayIndex(long)public static com.oracle.truffle.api.strings.TruffleString trimJSWhiteSpace(com.oracle.truffle.api.strings.TruffleString string)
public static int firstNonWhitespaceIndex(com.oracle.truffle.api.strings.TruffleString string,
com.oracle.truffle.api.strings.TruffleString.ReadCharUTF16Node charAtNode)
public static int lastNonWhitespaceIndex(com.oracle.truffle.api.strings.TruffleString string,
com.oracle.truffle.api.strings.TruffleString.ReadCharUTF16Node charAtNode)
public static boolean isWhiteSpaceOrLineTerminator(char cp)
public static boolean isWhiteSpaceExcludingLineTerminator(char cp)
public static boolean isLineTerminator(char codePoint)
public static boolean isValidArrayLength(long longValue)
public static boolean isValidArrayLength(double doubleValue)
public static boolean isValidArrayLength(int intValue)
public static boolean isIntegerIndex(long longValue)
public static boolean isArrayIndex(int intValue)
public static boolean isArrayIndex(long longValue)
public static boolean isArrayIndex(double doubleValue)
public static boolean isArrayIndexString(com.oracle.truffle.api.strings.TruffleString property)
public static boolean isArrayIndex(Object property)
public static long castArrayIndex(double doubleValue)
public static long castArrayIndex(long longValue)
public static boolean isAsciiDigit(int c)
public static long propertyNameToArrayIndex(com.oracle.truffle.api.strings.TruffleString propertyName,
com.oracle.truffle.api.strings.TruffleString.ReadCharUTF16Node charAtNode)
public static boolean arrayIndexLengthInRange(com.oracle.truffle.api.strings.TruffleString indexStr)
public static long propertyKeyToArrayIndex(Object propertyKey)
public static long propertyNameToIntegerIndex(com.oracle.truffle.api.strings.TruffleString propertyName)
public static long propertyKeyToIntegerIndex(Object propertyKey)
public static boolean isJSNative(Object value)
public static boolean isJSPrimitive(Object value)
public static com.oracle.truffle.api.strings.TruffleString toStringIsString(Object value)
public static boolean isStringClass(Class<?> clazz)
public static boolean isPropertyKey(Object key)
public static com.oracle.truffle.api.strings.TruffleString propertyKeyToFunctionNameString(Object key)
public static BigInt stringToBigInt(com.oracle.truffle.api.strings.TruffleString s)
public static int intValue(Number number)
Number.intValue()public static int intValueVirtual(Number number)
public static double doubleValue(Number number)
Number.doubleValue()public static double doubleValue(Number number, com.oracle.truffle.api.profiles.BranchProfile profile)
public static double doubleValueVirtual(Number number)
public static float floatValue(Number n)
Number.floatValue()public static float floatValueVirtual(Number n)
public static long longValue(Number n)
Number.longValue()public static long toLong(Number value)
public static String stringConcat(String first, String second)
public static JSDynamicObject fromPropertyDescriptor(PropertyDescriptor desc, JSContext context)
public static long getOffset(long start,
long length,
com.oracle.truffle.api.nodes.Node node,
com.oracle.truffle.api.profiles.InlinedConditionProfile profile)
public static int getOffset(int start,
int length,
com.oracle.truffle.api.nodes.Node node,
com.oracle.truffle.api.profiles.InlinedConditionProfile profile)
public static long parseSafeInteger(com.oracle.truffle.api.strings.TruffleString s)
public static long parseSafeInteger(com.oracle.truffle.api.strings.TruffleString s,
int beginIndex,
int endIndex,
int radix)
public static Number parseRawFitsLong(com.oracle.truffle.api.strings.TruffleString string, int radix, int startPos, int endPos, boolean negate)
public static double parseRawDontFitLong(com.oracle.truffle.api.strings.TruffleString string,
int radix,
int startPos,
int endPos,
boolean negate)
public static boolean createDataProperty(JSDynamicObject o, Object p, Object v)
public static boolean createDataProperty(JSDynamicObject o, Object p, Object v, boolean doThrow)
public static boolean createDataPropertyOrThrow(JSDynamicObject o, Object p, Object v)
public static void createNonEnumerableDataPropertyOrThrow(JSDynamicObject o, Object p, Object v)
public static void definePropertyOrThrow(JSDynamicObject o, Object key, PropertyDescriptor desc)
public static boolean isPrototypeOf(JSDynamicObject object, JSDynamicObject prototype)
public static JSDynamicObject createArrayFromList(JSContext context, JSRealm realm, List<? extends Object> list)
public static boolean isCallable(Object value)
public static boolean isCallableIsJSObject(JSDynamicObject value)
public static boolean isCallableForeign(Object value)
public static boolean isCallableProxy(JSDynamicObject proxy)
public static boolean isArray(Object obj)
public static boolean isProxyAnArray(JSDynamicObject proxy)
public static Object call(Object fnObj, Object holder, Object[] arguments)
public static Object call(Object fnObj, Object holder, Object[] arguments, com.oracle.truffle.api.nodes.Node encapsulatingNode)
public static Object canonicalNumericIndexString(com.oracle.truffle.api.strings.TruffleString s)
public static boolean isInteger(Object obj)
public static int comparePropertyKeys(Object key1, Object key2)
public static com.oracle.truffle.api.strings.TruffleString getConstructorName(JSDynamicObject receiver)
public static Object getDataProperty(JSDynamicObject thisObj, Object key)
public static boolean isJSRootNode(com.oracle.truffle.api.nodes.RootNode rootNode)
public static boolean isJSFunctionRootNode(com.oracle.truffle.api.nodes.RootNode rootNode)
public static boolean isSafeInteger(double value)
public static boolean isSafeInteger(long value)
public static boolean isConstructor(Object constrObj)
public static boolean isConstructorForeign(Object value)
public static boolean isConstructorProxy(JSDynamicObject constrObj)
public static boolean isGenerator(Object genObj)
public static boolean isGeneratorProxy(JSDynamicObject genObj)
public static List<Object> createListFromArrayLikeAllowSymbolString(Object obj)
public static com.oracle.truffle.api.strings.TruffleString quote(com.oracle.truffle.api.strings.TruffleString value)
public static JSDynamicObject expectJSObject(Object to, com.oracle.truffle.api.profiles.BranchProfile errorBranch)
public static Object exportValue(Object value)
public static Object importValue(Object value)
public static boolean intIsRepresentableAsFloat(int value)
public static boolean isJavaPrimitive(Object value)
public static <E extends Throwable> RuntimeException rethrow(Throwable ex) throws E extends Throwable
E extends Throwablepublic static GraalJSException getException(Object errorObject)
public static IteratorRecord getIterator(Object iteratedObject)
public static Object iteratorStep(IteratorRecord iteratorRecord)
public static void iteratorClose(Object iterator)
public static boolean isIntegralNumber(double arg)
public static boolean isPrivateSymbol(Object key)
public static Number toUint32(int value)
public static Object getBufferElementDirect(ByteBufferAccess bufferAccess, ByteBuffer buffer, TypedArray.ElementType elementType, int index)
public static void setBufferElementDirect(ByteBufferAccess bufferAccess, ByteBuffer buffer, TypedArray.ElementType elementType, int index, Object value)