Ignore:
Timestamp:
Sep 4, 2015, 12:48:54 PM (10 years ago)
Author:
[email protected]
Message:

Web Inspector: Test RuntimeAgent.parse, detecting if a script parse error is recoverable
https://bugs.webkit.org/show_bug.cgi?id=148790

Patch by Joseph Pecoraro <Joseph Pecoraro> on 2015-09-04
Reviewed by Timothy Hatcher.

Source/JavaScriptCore:

  • parser/Lexer.cpp:

(JSC::Lexer<T>::lex):

  • parser/Parser.cpp:

(JSC::Parser<LexerType>::printUnexpectedTokenText):

  • parser/ParserTokens.h:

More consistently name and treat unterminated numeric literals.

  • parser/Parser.h:

(JSC::Parser<LexerType>::parse):
Treat multiline capable unterminated literals as recoverable.

LayoutTests:

  • inspector/runtime/parse-expected.txt: Added.
  • inspector/runtime/parse.html: Added.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/parser/Parser.h

    r189201 r189371  
    13411341            if (m_token.m_type == EOFTOK)
    13421342                errorType = ParserError::SyntaxErrorRecoverable;
    1343             else if (m_token.m_type & UnterminatedErrorTokenFlag)
    1344                 errorType = ParserError::SyntaxErrorUnterminatedLiteral;
     1343            else if (m_token.m_type & UnterminatedErrorTokenFlag) {
     1344                // Treat multiline capable unterminated literals as recoverable.
     1345                if (m_token.m_type == UNTERMINATED_MULTILINE_COMMENT_ERRORTOK || m_token.m_type == UNTERMINATED_TEMPLATE_LITERAL_ERRORTOK)
     1346                    errorType = ParserError::SyntaxErrorRecoverable;
     1347                else
     1348                    errorType = ParserError::SyntaxErrorUnterminatedLiteral;
     1349            }
    13451350           
    13461351            if (isEvalNode<ParsedNode>())
Note: See TracChangeset for help on using the changeset viewer.