Closed GianlucaGuarini closed 1 year ago
Replacing an identifier with a member expression is not always safe. You’ll be replacing the keys in your object with e.g. scope.translateX
, which is not a valid key.
@eventualbuddha thank you for your feedback. The @riotjs/compiler
is much more complex than this demo. The code above is just needed to show the issue in recast that seems to be clearly related to the breaking spaces since the following demo works as expected: https://runkit.com/gianlucaguarini/5fe44ae13e9cdb001a56fc21
Ah, you're right. I don't know what's causing the issue you're seeing, but it does appear to be a bug. Thanks for clarifying.
@benjamn do you accept PRs? I might be interested in solving this issue with a patch
Yep, though it may not happen quickly.
@eventualbuddha I have tried to keep the patch simple https://github.com/benjamn/recast/pull/989 but your help on it is highly appreciated.
I am not able to reproduce this issue with the newest recast version. I am going to close this issue and my PR. Thank you anyway :)
I am working since days on a Riot.js compiler bug, this issue is driving me mad. I have noticed that the problem is coming from the recast.print method when it tries to generate the sourcemaps.
I was able to reproduce the issue with a few lines of code here
That's the code to reproduce it in case you want to try to copy and paste it directly in your editor:
Any hint or help solving this issue is really appreciated as long as the sourcemap output will be correct :)
Thank you