Ideally, Al·rishāʼ would validate the .nominalValue of a Literal before converting it using [Symbol.toPrimitive] or .valueOf(). If the .nominalValue is not in the lexical space for its .datatype, the string value of the .nominalValue should be returned instead. This would make it easy to check if a Literal is valid, by testing the return type of these functions.
(This is not a priority.)
Ideally, Al·rishāʼ would validate the
.nominalValue
of aLiteral
before converting it using[Symbol.toPrimitive]
or.valueOf()
. If the.nominalValue
is not in the lexical space for its.datatype
, the string value of the.nominalValue
should be returned instead. This would make it easy to check if aLiteral
is valid, by testing the return type of these functions.