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 object literal shorthand code generation bug #3931

Merged
merged 2 commits into from
Nov 16, 2019

Conversation

Conduitry
Copy link
Member

Fixes #3929.

@Conduitry
Copy link
Member Author

The test failures have informed me that apparently I broke the shorthand syntax optimization in certain situations which apparently were not tested for in code-red. Don't merge this - I'll take a look in a bit.

@Conduitry
Copy link
Member Author

Boring news flash: The changes arose because code-red is being passed { ctx: #ctx }, and so the name ctx doesn't equal #ctx by the time we're seeing whether we can use the shorthand notation, and #ctx only gets turned into ctx afterwards. I guess there was a reason after all for calling handle() on the value and then looking at that before deciding about the shorthand notation rather than just looking directly at the AST. In conclusion: bleh.

@Rich-Harris Rich-Harris merged commit bcb44c2 into sveltejs:master Nov 16, 2019
@Conduitry Conduitry deleted the gh-3929 branch November 16, 2019 19:40
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.

Reserved work used in prop default value outputs invalid javascript
2 participants