Attempting to invoke $pad with a decimal value length like 2.1 results in RangeError: invalid array length being thrown. This is due to the padding array being instantiated with a non-integer length which is not allowed. This exception is not caught anywhere in the call stack.
We should either floor width before using it to calculate padLength or throw a JSONata exception.
Hello,
Attempting to invoke
$pad
with a decimal value length like2.1
results inRangeError: invalid array length
being thrown. This is due to the padding array being instantiated with a non-integer length which is not allowed. This exception is not caught anywhere in the call stack.We should either floor
width
before using it to calculatepadLength
or throw a JSONata exception.Repro:
$pad("s", 2.1, " ")