Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix comma operator in debug #746

Merged
merged 6 commits into from
Jan 8, 2021
Merged

fix comma operator in debug #746

merged 6 commits into from
Jan 8, 2021

Conversation

pushkine
Copy link
Contributor

@pushkine pushkine commented Jan 7, 2021

Copy link
Member

@jasonlyu123 jasonlyu123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution. However, we might need a more complex solution on transformation for better sourcemap.

packages/svelte2tsx/src/htmlxtojsx/nodes/debug.ts Outdated Show resolved Hide resolved
Copy link
Member

@dummdidumm dummdidumm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Copy link
Member

@dummdidumm dummdidumm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found a bug in combination with $store usage. {@debug $store} is translated to __sveltets_store_get(myfile)}. Notice the missing { at the start. I guess either the remove in debug removes it or the inner store transformation. One way to fix this could be to remove the @debug like it was done before and overwrite only the , inbetween with }{.

@pushkine
Copy link
Contributor Author

pushkine commented Jan 8, 2021

It's related to the MagicString API, I have no idea how to use prepend/append left/right and the docs aren't helping, using prependLeft on both seems to cover the bug you found

@dummdidumm dummdidumm merged commit c8718b3 into sveltejs:master Jan 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants