-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Resolving #810: ES6 Object Literal Shorthand Detection #812
Conversation
I'm not opposed to test changes in general, but I don't understand why the change to the unencode tests is needed. I don't think that code path is touched by your change. Other than that, it looks reasonable to me. There's also the |
@@ -1196,6 +1196,17 @@ exports.test_data = { | |||
')' | |||
] | |||
}, | |||
{ | |||
comment: "Issue 810 - es6 object literal detection", | |||
unchanged: [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You might as well put both inputs that you listed in the issue report in here. They were just a little more interesting than this - worth covering.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will do that.
As for the updated test - it's because that test is currently in the format:
and on https://github.com/beautify-web/js-beautify/blob/master/test/template/python-javascript.mustache#L1237 that input gets wrapped in a
and then beautified and treated as an object literal. Replacing those commas with semicolons changes the test to treat them as single line expressions rather than part of an es6 object literal. |
Ah, okay. The javascript version of the test passed? Also, as a last point, an you take your changes and rebase them into one commit? Great work on this, BTW. Thanks! |
ebdcc17
to
dc472ee
Compare
Done and done! My team currently uses this (as part of |
Resolving #810: ES6 Object Literal Shorthand Detection
@timothyeburke - High quality and low friction. Glad to have you do anymore fixes you choose. 😄 |
I had to update some of the decode tests - they no longer made sense once wrapped in the second part of the test and were failing. Let me know if this works for you.