Class JSToObjectArrayNode
java.lang.Object
com.oracle.truffle.api.nodes.Node
com.oracle.truffle.js.nodes.JavaScriptBaseNode
com.oracle.truffle.js.nodes.cast.JSToObjectArrayNode
- All Implemented Interfaces:
com.oracle.truffle.api.nodes.NodeInterface, Cloneable
Converts an arbitrary array-like object to an Object[], with an optional array length limit.
By default, throws TypeError for null and undefined
(can be changed by using create(boolean)). Throws a RangeError if the array length
exceeds the optional array length limit or the maximum Java array size.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.oracle.truffle.api.nodes.Node
com.oracle.truffle.api.nodes.Node.Child, com.oracle.truffle.api.nodes.Node.Children -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic JSToObjectArrayNodecreate()static JSToObjectArrayNodecreate(boolean nullOrUndefinedAsEmptyArray) static JavaScriptNodecreate(JSContext context, JavaScriptNode operand) protected Object[]doFallback(Object value, int arrayLengthLimit) protected Object[]doForeignObject(Object obj, int arrayLengthLimit, com.oracle.truffle.api.nodes.Node node, com.oracle.truffle.api.interop.InteropLibrary interop, com.oracle.truffle.api.profiles.InlinedBranchProfile errorBranch, ImportValueNode foreignConvertNode) protected Object[]protected Object[]doUndefined(Object value, int arrayLengthLimit) final Object[]executeObjectArray(Object value) abstract Object[]executeObjectArray(Object value, int arrayLengthLimit) protected Object[]passArray(Object[] array, int arrayLengthLimit, com.oracle.truffle.api.profiles.InlinedBranchProfile errorBranch) protected Object[]toArray(JSObject obj, int arrayLengthLimit, com.oracle.truffle.api.nodes.Node node, JSGetLengthNode getLengthNode, ReadElementNode readNode, com.oracle.truffle.api.profiles.InlinedBranchProfile errorBranch) Methods inherited from class JavaScriptBaseNode
copy, getJSContext, getLanguage, getLanguageOptions, getRealm, hasOverloadedOperators, onReplace, reportLoopCount, reportLoopCountMethods inherited from class com.oracle.truffle.api.nodes.Node
accept, adoptChildren, atomic, atomic, deepCopy, getChildren, getCost, getDebugProperties, getDescription, getEncapsulatingSourceSection, getLock, getParent, getRootNode, getSourceSection, insert, insert, isAdoptable, isSafelyReplaceableBy, notifyInserted, replace, replace, reportPolymorphicSpecialize, reportReplace, toString
-
Field Details
-
nullOrUndefinedAsEmptyArray
protected final boolean nullOrUndefinedAsEmptyArray
-
-
Constructor Details
-
JSToObjectArrayNode
protected JSToObjectArrayNode(boolean nullOrUndefinedAsEmptyArray)
-
-
Method Details
-
executeObjectArray
-
executeObjectArray
-
create
-
create
-
create
-
toArray
protected Object[] toArray(JSObject obj, int arrayLengthLimit, com.oracle.truffle.api.nodes.Node node, JSGetLengthNode getLengthNode, ReadElementNode readNode, com.oracle.truffle.api.profiles.InlinedBranchProfile errorBranch) -
doUndefined
-
doNull
-
passArray
-
doForeignObject
protected Object[] doForeignObject(Object obj, int arrayLengthLimit, com.oracle.truffle.api.nodes.Node node, com.oracle.truffle.api.interop.InteropLibrary interop, com.oracle.truffle.api.profiles.InlinedBranchProfile errorBranch, ImportValueNode foreignConvertNode) -
doFallback
-