(forum is messing with us again... so I try again:)
...but with an a logical error, as I point out in #8. Because the original code - writing modules using new feature class - interestingly *** also from @MaBe *** - does not start the stopwatch on creation... just as I suggested.
There is nothing wrong to add the auto, because you do not want to have the extra code of starting the stopwatch. That's why you / @MaBe allow the "auto" to be passed. Makes absolute sense to me. To make the stopwatch robust though, it should object to start a started stopwatch with Illegal State Exception, which means that at the state the object is right now, a start is not possible... An additional property can indicate that the stopwatch is started or stopped. Combination of particular values of startTime and endTime could do that too: both are 0 or both are not 0 can do the test. Therefore:
Regarding your proof: works as designed / as by your setup. There is nothing that needs to be proofed. It is how the system works and nothing is found at fault with it.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
(forum is messing with us again... so I try again:)
...but with an a logical error, as I point out in #8. Because the original code - writing modules using new feature class - interestingly *** also from @MaBe *** - does not start the stopwatch on creation... just as I suggested.
There is nothing wrong to add the auto, because you do not want to have the extra code of starting the stopwatch. That's why you / @MaBe allow the "auto" to be passed. Makes absolute sense to me. To make the stopwatch robust though, it should object to start a started stopwatch with Illegal State Exception, which means that at the state the object is right now, a start is not possible... An additional property can indicate that the stopwatch is started or stopped. Combination of particular values of startTime and endTime could do that too: both are 0 or both are not 0 can do the test. Therefore:
See try...catch and throw in MDN...:
Regarding your proof: works as designed / as by your setup. There is nothing that needs to be proofed. It is how the system works and nothing is found at fault with it.