lightscript
lightscript copied to clipboard
single line do-while loop requires ;
do …; while … works but do … while … doesn't.
Iirc there was a grammar ambiguity otherwise. I don't recall what it was, might be possible to tell from the tests.
For the record, there is no grammar ambiguity here as of ES2016 (as far as I can tell, anyway) since while is a keyword. I fixed this one by adding while to the canInsertSemicolon whitelist, as I have with other illiberal ASI cases.
(There may be grammar ambiguities with do expressions enabled.)