When false, true or undefined are passed as retryConnectionDelay, they are all interpreted as 1000 ms. We change the constructor to interpret any value other than a number as 1000 ms. This allows us to simplify the value that is stored internally to just a number, and the complexity of the reconnect() method also goes down.
Implementers can use false as before, but false being interpreted as 1000ms is made more explicit. We can therefore easily see that the untested immediate connection line will never be hit, since given the default value in the constructor, a retryConnectionDelay was never going to be false.
When false, true or undefined are passed as retryConnectionDelay, they are all interpreted as 1000 ms. We change the constructor to interpret any value other than a number as 1000 ms. This allows us to simplify the value that is stored internally to just a number, and the complexity of the reconnect() method also goes down.
Implementers can use
false
as before, butfalse
being interpreted as 1000ms is made more explicit. We can therefore easily see that the untested immediate connection line will never be hit, since given the default value in the constructor, a retryConnectionDelay was never going to be false.