mirror of
https://github.com/beautifier/js-beautify.git
synced 2025-02-21 13:42:49 +00:00

We deliberately lose token_type = TK_COMMENT and TK_INLINE_COMMENT to allow their transparent handling. To counteract this, flags.had_comment counter-spell is implemented, so that we had a possibility to know that there was, in fact, a comment somewhere. Thus, we can fix some corner-cases where an unexpected comment might break the structure.