two places where parse then generate does not give you back what you put in.
every parser on this page is a real build from the babel monorepo; each pair differs only by the patch shown
under it. the buttons swap which build runs.
@babel/generator · not filed yet
("use strict") is not a directive: it is parenthesized, so the parser keeps it in
body and the surrounding code stays sloppy. the generator drops the parens, and the string is
read back as a directive. the code turns strict, and sometimes stops parsing altogether.
| input | babel prints | round trip |
|---|
@babel/parser · #17395
a backslash followed by U+2028 or U+2029 is a line continuation, same as a backslash
followed by a newline. the parser forgot to count it, so every position after it landed one line short.
| source | break is | string ends on | x is on | should be |
|---|