0
/*/*! why */
annotation*/

Does anyone know why annotation is not being annotation in this case? I checked VS code.

1
  • 2
    because the inner annotation (/*) is part of the comment and the comment will end with the first annotation closing Commented May 31, 2023 at 1:32

1 Answer 1

0

This is because JavaScript does not have nestable multiline comments (the same goes for plenty of other languages: Why, in general, are nested block comments NOT allowed?). If you want to read the language spec, see https://tc39.es/ecma262/multipage/ecmascript-language-lexical-grammar.html#sec-comments. Your second "/*" is treated as part of the multiline comment's body (MultiLineCommentChars), and your first "*/" closes the multiline comment. Your next line of "annotation*/" is outside of any comment, and invalid syntax.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.