Creates an instance of a LexicalError.
The human-readable error description.
The category of the lexical error.
OptionalcauseOptionalstackWhy the operation failed, see LexicalErrorType.
StaticduplicateCreates a LexicalError representing an item whose id is already stored in the list.
The duplicated identifier.
StaticfromCreates a LexicalError from an underlying position calculation error.
The position error to wrap.
StaticinvalidCreates a LexicalError representing an item whose id can't be stored in the list.
The invalid identifier (null or undefined).
StaticinvalidCreates a LexicalError representing an item whose position is empty or can't be forged.
The identifier of the item.
The invalid position.
Why the position is not valid.
StaticisIndicates whether the argument provided is a built-in Error instance or not.
StaticmapCreates a LexicalError representing a map traversal overflow.
StaticnotCreates a LexicalError representing neighbors that are not adjacent in the list.
The description of the invalid neighbors.
StaticnotCreates a LexicalError representing a missing item lookup.
The identifier that failed to match any existing item.
StaticnotCreates a LexicalError representing values whose positions are not in ascending order.
The index of the first value that breaks the order.
The id of the value before it.
The position of the value before it.
The id of the value that breaks the order.
Its position.
Returned (never thrown) when a
LexicalListoperation fails; itstypetells why. When an operation returns an error, neither the list nor your objects were changed.Example