Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions modules/juce_core/javascript/juce_JSON.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ struct JSONParser
auto c = readChar();

if (c == '}')
break;
throwError ("Unexpected trailing comma", errorLocation);

if (c == 0)
throwError ("Unexpected EOF in object declaration", startOfObjectDecl);
Expand Down Expand Up @@ -342,9 +342,10 @@ struct JSONParser
for (;;)
{
skipWhitespace();

auto errorLocation = currentLocation;

if (matchIf (']'))
break;
throwError ("Unexpected trailing comma", errorLocation);

if (isEOF())
throwError ("Unexpected EOF in array declaration", startOfArrayDecl);
Expand Down