Class JSRuntime
java.lang.Object
com.oracle.truffle.js.runtime.JSRuntime
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.oracle.truffle.api.object.HiddenKeystatic final longstatic final longstatic final longstatic final intstatic final intstatic final intstatic final longstatic final intstatic final doublestatic final intstatic final intstatic final longstatic final intstatic final doublestatic final intstatic final longstatic final double -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanarrayIndexLengthInRange(com.oracle.truffle.api.strings.TruffleString indexStr) static intbooleanToNumber(boolean value) static com.oracle.truffle.api.strings.TruffleStringbooleanToString(boolean value) static ObjectES2015 7.3.12 Call(F, V, arguments).static Objectcall(Object fnObj, Object holder, Object[] arguments, com.oracle.truffle.api.nodes.Node encapsulatingNode) static ObjectcanonicalNumericIndexString(com.oracle.truffle.api.strings.TruffleString s) ES2015, 7.1.16 CanonicalNumericIndexString().static longcastArrayIndex(double doubleValue) static longcastArrayIndex(long longValue) static com.oracle.truffle.api.strings.TruffleStringcollectionToConsoleString(JSDynamicObject obj, boolean allowSideEffects, ToDisplayStringFormat format, com.oracle.truffle.api.strings.TruffleString name, JSHashMap map, int depth) static intcomparePropertyKeys(Object key1, Object key2) Compare property keys such that a stable sort using it would maintain the following order.static Objectstatic JSDynamicObjectcreateArrayFromList(JSContext context, JSRealm realm, List<? extends Object> list) ES2016 7.3.16 CreateArrayFromList(elements).static booleancreateDataProperty(JSDynamicObject o, Object p, Object v) ES2015, 7.3.4 CreateDataProperty(O, P, V).static booleancreateDataProperty(JSDynamicObject o, Object p, Object v, boolean doThrow) static booleanES2015, 7.3.6 CreateDataPropertyOrThrow(O, P, V).static voidError Cause 7.3.6 CreateNonEnumerableDataPropertyOrThrow(O, P, V).static voiddefinePropertyOrThrow(JSDynamicObject o, Object key, PropertyDescriptor desc) ES2016, 7.3.7 DefinePropertyOrThrow(O, P, desc).static booleandoubleIsRepresentableAsInt(double d) static booleandoubleIsRepresentableAsInt(double d, boolean ignoreNegativeZero) static booleandoubleIsRepresentableAsLong(double d) static booleandoubleIsRepresentableAsUnsignedInt(double d, boolean ignoreNegativeZero) static NumberdoubleToNarrowestNumber(double d) static com.oracle.truffle.api.strings.TruffleStringdoubleToString(double d) 9.8.1 ToString Applied to the Number Type.static ObjectdoubleToString(double d, int radix) static doubledoubleValue(Number number) static doubledoubleValueVirtual(Number number) static booleanstatic JSDynamicObjectexpectJSObject(Object to, com.oracle.truffle.api.profiles.BranchProfile errorBranch) static ObjectexportValue(Object value) Convert the value to a type valid in Truffle Interop.static Object[]exportValueArray(Object[] arr) filterPrivateSymbols(List<Object> list) static intfirstExpIndexInString(com.oracle.truffle.api.strings.TruffleString str) Returns the first index of a String that contains either 'e' or 'E'.static intfirstNonWhitespaceIndex(com.oracle.truffle.api.strings.TruffleString string, com.oracle.truffle.api.strings.TruffleString.ReadCharUTF16Node charAtNode) static floatfloatValue(Number n) static floatstatic StringformatDtoA(double value) static ObjectformatDtoA(double d, int radix) static ObjectformatDtoAExponential(double d) static ObjectformatDtoAExponential(double d, int digits) static ObjectformatDtoAFixed(double value, int digits) static ObjectformatDtoAPrecision(double value, int precision) static JSDynamicObjectfromPropertyDescriptor(PropertyDescriptor desc, JSContext context) static Objectstatic Objectstatic Objectstatic ObjectgetArgOrUndefined(Object[] args, int i) static ObjectgetBufferElementDirect(ByteBufferAccess bufferAccess, ByteBuffer buffer, TypedArray.ElementType elementType, int index) static com.oracle.truffle.api.strings.TruffleStringgetConstructorName(JSObject receiver) static com.oracle.truffle.api.strings.TruffleStringgetConstructorName(JSObject receiver, com.oracle.truffle.api.strings.TruffleString defaultName) Carefully try getting the constructor name, must not throw.static ObjectgetDataProperty(JSDynamicObject thisObj, Object key) static com.oracle.truffle.api.exception.AbstractTruffleExceptiongetException(Object errorObject) static com.oracle.truffle.api.exception.AbstractTruffleExceptiongetException(Object errorObject, com.oracle.truffle.api.nodes.Node node) static JSRealmgetFunctionRealm(Object obj, JSRealm currentRealm) static IteratorRecordgetIterator(Object iteratedObject) static intgetOffset(int start, int length, com.oracle.truffle.api.nodes.Node node, com.oracle.truffle.api.profiles.InlinedConditionProfile profile) static longgetOffset(long start, long length, com.oracle.truffle.api.nodes.Node node, com.oracle.truffle.api.profiles.InlinedConditionProfile profile) static com.oracle.truffle.api.strings.TruffleStringgetPrimitiveConstructorName(Object primitive) static booleanhasProperty(Object obj, Object key) static booleanstatic doubleidentifyInfinity(char firstChar, int len) static ObjectimportValue(Object value) Convert the value to a type valid in Graal.js, from something received via TruffleInterop.static booleanintIsRepresentableAsFloat(int value) static intstatic intintValueVirtual(Number number) static booleanES2015 7.2.2 IsArray(argument).static booleanisArrayIndex(double doubleValue) static booleanisArrayIndex(int intValue) static booleanisArrayIndex(long longValue) static booleanisArrayIndex(Object property) static booleanisArrayIndexString(com.oracle.truffle.api.strings.TruffleString property) static booleanisAsciiDigit(int c) static booleanisAsciiWhitespace(char cp) static booleanstatic booleanisCallable(Object value) ES2015 7.2.3 IsCallable(argument).static booleanisCallableForeign(Object value) static booleanstatic booleanisCallableProxy(JSDynamicObject proxy) static booleanisConstructor(Object constrObj) ES2016 7.2.4 IsConstructor().static booleanisConstructorForeign(Object value) static booleanisConstructorProxy(JSDynamicObject constrObj) static booleanisForeignObject(com.oracle.truffle.api.interop.TruffleObject value) static booleanisForeignObject(Object value) static booleanisGenerator(Object genObj) static booleanisGeneratorProxy(JSDynamicObject genObj) static booleanisHex(char c) static booleanES2015, 7.2.6 IsInteger.static booleanisIntegerIndex(long longValue) static booleanisIntegralNumber(double arg) static booleanisJavaNumber(Object value) static booleanisJavaPrimitive(Object value) static booleanisJSFunctionRootNode(com.oracle.truffle.api.nodes.RootNode rootNode) static booleanisJSNative(Object value) Is value a native JavaScript object or primitive?static booleanisJSPrimitive(Object value) static booleanisJSRootNode(com.oracle.truffle.api.nodes.RootNode rootNode) static booleanisLineTerminator(char codePoint) static booleanstatic booleanisNegativeZero(double d) static booleanReturns whethervalueis JSnullorundefinedor a foreign null.static booleanisNullOrUndefined(Object value) Returns whethervalueis JSnullorundefined.static booleanstatic booleanReturns whether object is a JSObject.static booleanisPositiveInfinity(double d) static booleanisPrivateSymbol(Object key) static booleanisPropertyKey(Object key) static booleanisPrototypeOf(JSDynamicObject object, JSDynamicObject prototype) static booleanisProxyAnArray(JSDynamicObject proxy) static booleanisRepresentableAsUnsignedInt(long value) static booleanisSafeInteger(double value) static booleanisSafeInteger(long value) static booleanisSameValue(Object x, Object y) 9.12 SameValue Algorithm.static booleanisValidArrayLength(double doubleValue) static booleanisValidArrayLength(int intValue) static booleanisValidArrayLength(long longValue) Checks whether a long value is within the valid range of array lengths.static booleanisWhiteSpaceExcludingLineTerminator(char cp) WhiteSpace (excluding LineTerminator).static booleanisWhiteSpaceOrLineTerminator(int cp) Union of WhiteSpace and LineTerminator (StrWhiteSpaceChar).static voiditeratorClose(Object iterator) static ObjectiteratorStep(IteratorRecord iteratorRecord) static ObjectiteratorValue(Object iterator) static intlastNonWhitespaceIndex(com.oracle.truffle.api.strings.TruffleString string, com.oracle.truffle.api.strings.TruffleString.ReadCharUTF16Node charAtNode) static booleanlongFitsInDouble(long l) static booleanlongIsRepresentableAsInt(long value) static NumberlongToIntOrDouble(long value) static longstatic ObjectnullToUndefined(Object value) static com.oracle.truffle.api.strings.TruffleStringnumberToString(Number number) static com.oracle.truffle.api.strings.TruffleStringobjectToDisplayString(JSDynamicObject obj, boolean allowSideEffects, ToDisplayStringFormat format, int depth, com.oracle.truffle.api.strings.TruffleString name) static com.oracle.truffle.api.strings.TruffleStringobjectToDisplayString(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 longstatic longparseArrayIndexRaw(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 doubleparseDoubleOrNaN(com.oracle.truffle.api.strings.TruffleString input) static doubleparseRawDontFitLong(com.oracle.truffle.api.strings.TruffleString string, int radix, int startPos, int endPos, boolean negate) static NumberparseRawFitsLong(com.oracle.truffle.api.strings.TruffleString string, int radix, int startPos, int endPos, boolean negate) static longparseSafeInteger(com.oracle.truffle.api.strings.TruffleString s) static longparseSafeInteger(com.oracle.truffle.api.strings.TruffleString s, int beginIndex, int endIndex, int radix) static ObjectpositiveLongToIntOrDouble(long value) static booleanpropertyKeyEquals(com.oracle.truffle.api.strings.TruffleString.EqualNode equalsNode, Object a, Object b) static longpropertyKeyToArrayIndex(Object propertyKey) static com.oracle.truffle.api.strings.TruffleStringstatic longpropertyKeyToIntegerIndex(Object propertyKey) static longpropertyNameToArrayIndex(com.oracle.truffle.api.strings.TruffleString propertyName, com.oracle.truffle.api.strings.TruffleString.ReadCharUTF16Node charAtNode) static longpropertyNameToIntegerIndex(com.oracle.truffle.api.strings.TruffleString propertyName) static com.oracle.truffle.api.strings.TruffleStringquote(com.oracle.truffle.api.strings.TruffleString value) Implementation of the Quote(value) operation as defined in the ECMAscript spec.static Stringstatic <T> TrequireObjectCoercible(T argument) Implementation of the abstract operation RequireObjectCoercible.static <E extends Throwable>
RuntimeExceptionstatic com.oracle.truffle.api.strings.TruffleStringsafeToString(Object value) static voidsetBufferElementDirect(ByteBufferAccess bufferAccess, ByteBuffer buffer, TypedArray.ElementType elementType, int index, Object value) static BigIntstringToBigInt(com.oracle.truffle.api.strings.TruffleString s) static NumberstringToNumber(com.oracle.truffle.api.strings.TruffleString string) Implementation of ECMA 9.3.1 "ToNumber Applied to the String Type".static BigIntstatic BigIntegertoBigInteger(double integer) static booleanImplementation of ECMA 9.2 "ToBoolean".static com.oracle.truffle.api.strings.TruffleStringtoDisplayString(Object value, boolean allowSideEffects) static com.oracle.truffle.api.strings.TruffleStringtoDisplayString(Object value, boolean allowSideEffects, ToDisplayStringFormat format) static com.oracle.truffle.api.strings.TruffleStringtoDisplayStringImpl(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.TruffleStringtoDisplayStringInner(Object value, boolean allowSideEffects, ToDisplayStringFormat format, int currentDepth, Object parent) static doubleToDouble for Numbers.static doubleNon-standard "ToDouble" utility function.static shorttoFloat16(double d) static shortstatic inttoInt32(double value) static intConvert JS number to int32.static intImplementation of ECMA 9.5 "ToInt32".static inttoInt32NoTruncate(double value) static longstatic longImplementation of ECMA 9.4 "ToInteger".static ObjecttoJavaNull(Object value) static StringtoJavaString(Object value) static Objectstatic doubletoLength(double d) static inttoLength(int value) static longtoLength(long l) static longImplementation of ECMAScript6 7.1.15 "ToLength".static NumberImplementation of ECMA 9.3 "ToNumber".static Objectstatic ObjectImplementation of ECMA 9.9 "ToObject".static ObjecttoPrimitive(Object value) Implementation of ECMA 7.1.1 "ToPrimitive", with NO hint given.static ObjecttoPrimitive(Object value, JSToPrimitiveNode.Hint hint) Implementation of ECMA 7.1.1 "ToPrimitive".static PropertyDescriptortoPropertyDescriptor(Object property) Implementation of the ToPropertyDescriptor function as defined in ECMA 8.10.5.static ObjecttoPropertyKey(Object arg) ES2015 7.1.14 ToPropertyKey(argument).static com.oracle.truffle.api.strings.TruffleStringtoString(JSDynamicObject value) static com.oracle.truffle.api.strings.TruffleStringThe abstract operation ToString.static inttoUInt16(long number) static intstatic intImplementation of ECMA 9.7 "ToUInt16".static NumbertoUint32(int value) static longtoUInt32(double value) static longtoUInt32(long value) static longToUint32 after previous ToNumber conversion.static longImplementation of ECMA 9.6 "ToUInt32".static longtoUInt32NoTruncate(double value) static com.oracle.truffle.api.strings.TruffleStringtrimJSWhiteSpace(com.oracle.truffle.api.strings.TruffleString string) static doubletruncateDouble(double value) static com.oracle.truffle.api.strings.TruffleStringstatic intvalueInHex(char c) static intvalueInRadix(char c, int radix) static intvalueInRadix10(char c)
-
Field Details
-
TWO32
public static final double TWO32- See Also:
-
INVALID_ARRAY_INDEX
public static final long INVALID_ARRAY_INDEX- See Also:
-
MAX_ARRAY_LENGTH
public static final long MAX_ARRAY_LENGTH- See Also:
-
MAX_UINT32_DIGITS
public static final int MAX_UINT32_DIGITS- See Also:
-
MAX_SAFE_INTEGER
public static final double MAX_SAFE_INTEGER -
MIN_SAFE_INTEGER
public static final double MIN_SAFE_INTEGER -
MAX_SAFE_INTEGER_LONG
public static final long MAX_SAFE_INTEGER_LONG -
MIN_SAFE_INTEGER_LONG
public static final long MIN_SAFE_INTEGER_LONG -
INVALID_INTEGER_INDEX
public static final long INVALID_INTEGER_INDEX- See Also:
-
MAX_INTEGER_INDEX_DIGITS
public static final int MAX_INTEGER_INDEX_DIGITS- See Also:
-
MAX_SAFE_INTEGER_DIGITS
public static final int MAX_SAFE_INTEGER_DIGITS- See Also:
-
MAX_SAFE_INTEGER_IN_FLOAT
public static final int MAX_SAFE_INTEGER_IN_FLOAT- See Also:
-
MIN_SAFE_INTEGER_IN_FLOAT
public static final int MIN_SAFE_INTEGER_IN_FLOAT- See Also:
-
INVALID_SAFE_INTEGER
public static final long INVALID_SAFE_INTEGER- See Also:
-
ENUMERATE_ITERATOR_ID
public static final com.oracle.truffle.api.object.HiddenKey ENUMERATE_ITERATOR_ID -
ITERATION_KIND_KEY
public static final int ITERATION_KIND_KEY- See Also:
-
ITERATION_KIND_VALUE
public static final int ITERATION_KIND_VALUE- See Also:
-
ITERATION_KIND_KEY_PLUS_VALUE
public static final int ITERATION_KIND_KEY_PLUS_VALUE- See Also:
-
-
Method Details
-
doubleIsRepresentableAsInt
public static boolean doubleIsRepresentableAsInt(double d) -
doubleIsRepresentableAsInt
public static boolean doubleIsRepresentableAsInt(double d, boolean ignoreNegativeZero) -
doubleIsRepresentableAsUnsignedInt
public static boolean doubleIsRepresentableAsUnsignedInt(double d, boolean ignoreNegativeZero) -
isNegativeZero
public static boolean isNegativeZero(double d) -
isPositiveInfinity
public static boolean isPositiveInfinity(double d) -
doubleToNarrowestNumber
-
longIsRepresentableAsInt
public static boolean longIsRepresentableAsInt(long value) -
isRepresentableAsUnsignedInt
public static boolean isRepresentableAsUnsignedInt(long value) -
doubleIsRepresentableAsLong
public static boolean doubleIsRepresentableAsLong(double d) -
positiveLongToIntOrDouble
-
longToIntOrDouble
-
longFitsInDouble
public static boolean longFitsInDouble(long l) -
isNaN
-
typeof
-
isObject
Returns whether object is a JSObject. JS-Null and JS-Undefined are not considered objects. -
isNullOrUndefined
Returns whethervalueis JSnullorundefined. -
isNullish
Returns whethervalueis JSnullorundefinedor a foreign null. -
toPrimitive
-
toPrimitive
Implementation of ECMA 7.1.1 "ToPrimitive".- Parameters:
value- an Object to be converted to a primitive valuehint- the preferred type of primitive to return ("number", "string" or "default")- Returns:
- an Object representing the primitive value of the parameter
- See Also:
-
toBoolean
Implementation of ECMA 9.2 "ToBoolean".- Parameters:
value- an Object to be converted to a Boolean- Returns:
- an Object representing the primitive value of the parameter
-
toNumber
-
toNumeric
-
booleanToNumber
public static int booleanToNumber(boolean value) -
isNumber
-
toBigInt
-
isBigInt
-
isJavaNumber
-
stringToNumber
Implementation of ECMA 9.3.1 "ToNumber Applied to the String Type".- Parameters:
string-- Returns:
- a Number
-
parseDoubleOrNaN
public static double parseDoubleOrNaN(com.oracle.truffle.api.strings.TruffleString input) - Returns:
- double value or
Double.NaNif not parsable.
-
firstExpIndexInString
public static int firstExpIndexInString(com.oracle.truffle.api.strings.TruffleString str) Returns the first index of a String that contains either 'e' or 'E'. -
identifyInfinity
public static double identifyInfinity(char firstChar, int len) -
toInteger
Implementation of ECMA 9.4 "ToInteger".- Parameters:
value- an Object to be converted to an Integer- Returns:
- an Object representing the Integer value of the parameter
-
toInteger
-
toLength
Implementation of ECMAScript6 7.1.15 "ToLength". -
toLength
public static double toLength(double d) -
toLength
public static long toLength(long l) -
toLength
public static int toLength(int value) -
toUInt16
Implementation of ECMA 9.7 "ToUInt16".- Parameters:
value- an Object to be converted to a UInt16- Returns:
- an Object representing the Number value of the parameter
-
toUInt16
-
toUInt16
public static int toUInt16(long number) -
toUInt32
Implementation of ECMA 9.6 "ToUInt32".- Parameters:
value- an Object to be converted to a UInt32- Returns:
- an Object representing the Number value of the parameter
-
toUInt32
ToUint32 after previous ToNumber conversion. -
toUInt32
public static long toUInt32(long value) -
toUInt32
public static long toUInt32(double value) -
toUInt32NoTruncate
public static long toUInt32NoTruncate(double value) -
truncateDouble
public static double truncateDouble(double value) -
toInt32
Implementation of ECMA 9.5 "ToInt32".- Parameters:
value- an Object to be converted to a Int32- Returns:
- an Object representing the Number value of the parameter
-
toInt32
Convert JS number to int32. -
toInt32
public static int toInt32(double value) -
toInt32NoTruncate
public static int toInt32NoTruncate(double value) -
toDouble
Non-standard "ToDouble" utility function.- Returns:
- the result of calling ToNumber, but converted to a primitive double
-
toDouble
ToDouble for Numbers. In fact, just forwarding to doubleValue(). Keep it, as otherwise it is very easy to mistakenly call toDouble() inadvertently. -
toJavaString
-
toString
The abstract operation ToString. Converts a value to a string. -
safeToString
-
toDisplayString
public static com.oracle.truffle.api.strings.TruffleString toDisplayString(Object value, boolean allowSideEffects) -
toDisplayString
public static com.oracle.truffle.api.strings.TruffleString toDisplayString(Object value, boolean allowSideEffects, ToDisplayStringFormat format) -
toDisplayStringInner
public static com.oracle.truffle.api.strings.TruffleString toDisplayStringInner(Object value, boolean allowSideEffects, ToDisplayStringFormat format, int currentDepth, Object parent) -
toDisplayStringImpl
public 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.- Parameters:
format- formatting parametersdepth- current recursion depth (starts at 0 = top level)parent- parent object or null
-
objectToDisplayString
public static com.oracle.truffle.api.strings.TruffleString objectToDisplayString(JSDynamicObject obj, boolean allowSideEffects, ToDisplayStringFormat format, int depth, com.oracle.truffle.api.strings.TruffleString name) -
objectToDisplayString
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) -
collectionToConsoleString
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) -
booleanToString
public static com.oracle.truffle.api.strings.TruffleString booleanToString(boolean value) -
toString
-
numberToString
-
propertyKeyEquals
-
doubleToString
-
doubleToString
public static com.oracle.truffle.api.strings.TruffleString doubleToString(double d) 9.8.1 ToString Applied to the Number Type.Better use JSDoubleToStringNode where appropriate.
-
formatDtoA
-
formatDtoAPrecision
-
formatDtoAExponential
-
formatDtoAExponential
-
formatDtoAFixed
-
formatDtoA
-
toObject
-
isSameValue
-
equal
-
isForeignObject
-
isForeignObject
public static boolean isForeignObject(com.oracle.truffle.api.interop.TruffleObject value) -
identical
-
requireObjectCoercible
public static <T> T requireObjectCoercible(T argument) Implementation of the abstract operation RequireObjectCoercible. -
toPropertyDescriptor
Implementation of the ToPropertyDescriptor function as defined in ECMA 8.10.5.- Returns:
- a property descriptor
-
valueInRadix10
public static int valueInRadix10(char c) -
valueInRadix
public static int valueInRadix(char c, int radix) -
valueInHex
public static int valueInHex(char c) -
isHex
public static boolean isHex(char c) -
parseArrayIndexIsIndexRaw
-
parseArrayIndexRaw
public 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. The caller is responsible for the range check and must take care not to pass in too long strings.- Returns:
- parsed unsigned integer value or INVALID_UINT32 if the string is not parsable.
- See Also:
-
trimJSWhiteSpace
public static com.oracle.truffle.api.strings.TruffleString trimJSWhiteSpace(com.oracle.truffle.api.strings.TruffleString string) -
firstNonWhitespaceIndex
public static int firstNonWhitespaceIndex(com.oracle.truffle.api.strings.TruffleString string, com.oracle.truffle.api.strings.TruffleString.ReadCharUTF16Node charAtNode) -
lastNonWhitespaceIndex
public static int lastNonWhitespaceIndex(com.oracle.truffle.api.strings.TruffleString string, com.oracle.truffle.api.strings.TruffleString.ReadCharUTF16Node charAtNode) -
isWhiteSpaceOrLineTerminator
public static boolean isWhiteSpaceOrLineTerminator(int cp) Union of WhiteSpace and LineTerminator (StrWhiteSpaceChar). Used by TrimString. -
isWhiteSpaceExcludingLineTerminator
public static boolean isWhiteSpaceExcludingLineTerminator(char cp) WhiteSpace (excluding LineTerminator). -
isLineTerminator
public static boolean isLineTerminator(char codePoint) -
isAsciiWhitespace
public static boolean isAsciiWhitespace(char cp) -
isValidArrayLength
public static boolean isValidArrayLength(long longValue) Checks whether a long value is within the valid range of array lengths. Note the difference to isArrayIndex, that does not allow the MAX_ARRAY_LENGTH value. -
isValidArrayLength
public static boolean isValidArrayLength(double doubleValue) -
isValidArrayLength
public static boolean isValidArrayLength(int intValue) -
isIntegerIndex
public static boolean isIntegerIndex(long longValue) -
isArrayIndex
public static boolean isArrayIndex(int intValue) -
isArrayIndex
public static boolean isArrayIndex(long longValue) -
isArrayIndex
public static boolean isArrayIndex(double doubleValue) -
isArrayIndexString
public static boolean isArrayIndexString(com.oracle.truffle.api.strings.TruffleString property) -
isArrayIndex
-
castArrayIndex
public static long castArrayIndex(double doubleValue) -
castArrayIndex
public static long castArrayIndex(long longValue) -
isAsciiDigit
public static boolean isAsciiDigit(int c) -
propertyNameToArrayIndex
public static long propertyNameToArrayIndex(com.oracle.truffle.api.strings.TruffleString propertyName, com.oracle.truffle.api.strings.TruffleString.ReadCharUTF16Node charAtNode) -
arrayIndexLengthInRange
public static boolean arrayIndexLengthInRange(com.oracle.truffle.api.strings.TruffleString indexStr) -
propertyKeyToArrayIndex
-
propertyNameToIntegerIndex
public static long propertyNameToIntegerIndex(com.oracle.truffle.api.strings.TruffleString propertyName) -
propertyKeyToIntegerIndex
-
isJSNative
Is value a native JavaScript object or primitive? -
isJSPrimitive
-
nullToUndefined
-
toJSNull
-
toJavaNull
-
isPropertyKey
-
propertyKeyToFunctionNameString
public static com.oracle.truffle.api.strings.TruffleString propertyKeyToFunctionNameString(Object key) -
stringToBigInt
-
intValue
- See Also:
-
intValueVirtual
-
doubleValue
- See Also:
-
doubleValueVirtual
-
floatValue
- See Also:
-
floatValueVirtual
-
longValue
- See Also:
-
fromPropertyDescriptor
-
getArgOrUndefined
-
getArg
-
getOffset
public static long getOffset(long start, long length, com.oracle.truffle.api.nodes.Node node, com.oracle.truffle.api.profiles.InlinedConditionProfile profile) -
getOffset
public static int getOffset(int start, int length, com.oracle.truffle.api.nodes.Node node, com.oracle.truffle.api.profiles.InlinedConditionProfile profile) -
parseSafeInteger
public static long parseSafeInteger(com.oracle.truffle.api.strings.TruffleString s) -
parseSafeInteger
public static long parseSafeInteger(com.oracle.truffle.api.strings.TruffleString s, int beginIndex, int endIndex, int radix) -
parseRawFitsLong
public static Number parseRawFitsLong(com.oracle.truffle.api.strings.TruffleString string, int radix, int startPos, int endPos, boolean negate) -
parseRawDontFitLong
public static double parseRawDontFitLong(com.oracle.truffle.api.strings.TruffleString string, int radix, int startPos, int endPos, boolean negate) -
createDataProperty
ES2015, 7.3.4 CreateDataProperty(O, P, V). -
createDataProperty
-
createDataPropertyOrThrow
ES2015, 7.3.6 CreateDataPropertyOrThrow(O, P, V). -
createNonEnumerableDataPropertyOrThrow
Error Cause 7.3.6 CreateNonEnumerableDataPropertyOrThrow(O, P, V). -
definePropertyOrThrow
ES2016, 7.3.7 DefinePropertyOrThrow(O, P, desc). -
isPrototypeOf
-
createArrayFromList
public static JSDynamicObject createArrayFromList(JSContext context, JSRealm realm, List<? extends Object> list) ES2016 7.3.16 CreateArrayFromList(elements). -
isCallable
ES2015 7.2.3 IsCallable(argument). -
isCallableIsJSObject
-
isCallableForeign
-
isCallableProxy
-
isArray
ES2015 7.2.2 IsArray(argument). -
isProxyAnArray
-
toPropertyKey
-
call
-
call
-
construct
-
canonicalNumericIndexString
ES2015, 7.1.16 CanonicalNumericIndexString(). -
isInteger
ES2015, 7.2.6 IsInteger. -
comparePropertyKeys
-
getConstructorName
-
getConstructorName
public static com.oracle.truffle.api.strings.TruffleString getConstructorName(JSObject receiver, com.oracle.truffle.api.strings.TruffleString defaultName) Carefully try getting the constructor name, must not throw. -
getPrimitiveConstructorName
public static com.oracle.truffle.api.strings.TruffleString getPrimitiveConstructorName(Object primitive) -
getDataProperty
-
isJSRootNode
public static boolean isJSRootNode(com.oracle.truffle.api.nodes.RootNode rootNode) -
isJSFunctionRootNode
public static boolean isJSFunctionRootNode(com.oracle.truffle.api.nodes.RootNode rootNode) -
isSafeInteger
public static boolean isSafeInteger(double value) -
isSafeInteger
public static boolean isSafeInteger(long value) -
getFunctionRealm
-
isConstructor
ES2016 7.2.4 IsConstructor(). -
isConstructorForeign
-
isConstructorProxy
-
isGenerator
-
isGeneratorProxy
-
createListFromArrayLikeAllowSymbolString
-
quote
-
quote
public static com.oracle.truffle.api.strings.TruffleString quote(com.oracle.truffle.api.strings.TruffleString value) Implementation of the Quote(value) operation as defined in the ECMAscript spec. It wraps a String value in double quotes and escapes characters within.- Parameters:
value- string to quote- Returns:
- quoted and escaped string
-
expectJSObject
public static JSDynamicObject expectJSObject(Object to, com.oracle.truffle.api.profiles.BranchProfile errorBranch) -
exportValue
-
exportValueArray
-
importValue
-
intIsRepresentableAsFloat
public static boolean intIsRepresentableAsFloat(int value) -
isJavaPrimitive
-
rethrow
- Throws:
E
-
getException
public static com.oracle.truffle.api.exception.AbstractTruffleException getException(Object errorObject) -
getException
public static com.oracle.truffle.api.exception.AbstractTruffleException getException(Object errorObject, com.oracle.truffle.api.nodes.Node node) -
getIterator
-
iteratorStep
-
iteratorValue
-
iteratorClose
-
isIntegralNumber
public static boolean isIntegralNumber(double arg) -
get
-
get
-
hasProperty
-
isPrivateSymbol
-
filterPrivateSymbols
-
toUint32
-
toFloat16
-
toFloat16
public static short toFloat16(double d) -
toBigInteger
-
getBufferElementDirect
public static Object getBufferElementDirect(ByteBufferAccess bufferAccess, ByteBuffer buffer, TypedArray.ElementType elementType, int index) -
setBufferElementDirect
public static void setBufferElementDirect(ByteBufferAccess bufferAccess, ByteBuffer buffer, TypedArray.ElementType elementType, int index, Object value)
-