Skip to content

Conversation

@sqs
Copy link
Contributor

@sqs sqs commented Mar 3, 2018

Previously, allowTrailingCommas only allowed trailing commas in objects, and it would still return errors for JSON like [1, 2, ]. This was surprising to me as a user. Is there a reason for allowing trailing commas in objects but not arrays?

Also fixes the assertValidParse helper. It was not failing even when there were parse errors (because it only failed if there were parse errors AND the first parse error's code was "undefined"; I couldn't find a case where that would be true).

sqs added 2 commits March 2, 2018 22:14
Previously, allowTrailingCommas only allowed trailing commas in objects.
Previously, it only failed the test if an error's code was "undefined".
@aeschli
Copy link
Contributor

aeschli commented Mar 5, 2018

Makes sense, thanks @sqs !

@sqs
Copy link
Contributor Author

sqs commented Mar 5, 2018

Thanks for the quick merge! BTW we are shipping this in Sourcegraph Server for users and admins to edit config. It works great.

@aeschli aeschli added this to the March 2018 milestone Mar 29, 2018
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.

2 participants