Ignore:
Timestamp:
Aug 27, 2009, 12:15:31 PM (16 years ago)
Author:
[email protected]
Message:

JSON parser accepts trailing comma in array literals
https://bugs.webkit.org/show_bug.cgi?id=28779

Reviewed by Alexey Proskuryakov.

Update parser to correctly fail if there's a trailing comma.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/runtime/LiteralParser.cpp

    r46910 r47828  
    296296            doParseArrayStartExpression:
    297297            case DoParseArrayStartExpression: {
     298                TokenType lastToken = m_lexer.currentToken().type;
    298299                if (m_lexer.next() == TokRBracket) {
     300                    if (lastToken == TokComma)
     301                        return JSValue();
    299302                    m_lexer.next();
    300303                    lastValue = objectStack.last();
Note: See TracChangeset for help on using the changeset viewer.