If you create a file with a comment as the final line and save it, then attempt to load it again, the reload fails, because there is no final newline at the end of the last comment.
I notice that the renderAsSource for both global-comment and comment-statement do not have a \r unlike other frames. This is so that there is no blank line inserted between successive comments.
So the fix needs to be in FileImple.renderHashableContent(): add a test that the source ends in \r\n and, if not, appends it automatically.
(Reported by Nela)
If you create a file with a comment as the final line and save it, then attempt to load it again, the reload fails, because there is no final newline at the end of the last comment.
I notice that the
renderAsSource
for bothglobal-comment
andcomment-statement
do not have a\r
unlike other frames. This is so that there is no blank line inserted between successive comments.So the fix needs to be in
FileImple.renderHashableContent()
: add a test that the source ends in\r\n
and, if not, appends it automatically.