You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When attaching comments and generating code there seems to be a bug with the placement of inline comments.
They always break up the line which can lead to problems, for example when returning objects in strict mode.
Lets take this sample code snippet:
functiontest(){"use strict";return/** some inline comment */{someFunc: function(){}};}
When parsing it with acorn and then attaching comments with escodegen and generating the code like this:
When attaching comments and generating code there seems to be a bug with the placement of inline comments.
They always break up the line which can lead to problems, for example when returning objects in strict mode.
Lets take this sample code snippet:
When parsing it with acorn and then attaching comments with escodegen and generating the code like this:
the output is generated as
Notice how the curly brace of the object got moved to a new line, which breaks due to the strict mode, similar to this error (https://stackoverflow.com/a/63953324/5843525)
It generally seems to be a problem that inline comments break up code lines in unexpected ways.
The text was updated successfully, but these errors were encountered: