Ignore:
Timestamp:
Jul 8, 2010, 4:22:21 PM (15 years ago)
Author:
[email protected]
Message:

2010-07-08 Oliver Hunt <[email protected]>

Reviewed by Gavin Barraclough.

JavaScript parser violates ECMA automatic semicolon insertion rule
https://bugs.webkit.org/show_bug.cgi?id=41844

Remove (very) old and bogus logic that automatically inserted a semicolon
at the end of a script's source.

  • parser/Lexer.cpp: (JSC::Lexer::lex):

2010-07-08 Oliver Hunt <[email protected]>

Reviewed by Gavin Barraclough.

JavaScript parser violates ECMA automatic semicolon insertion rule
https://bugs.webkit.org/show_bug.cgi?id=41844

Add testcase to ensure that we don't automatically insert a semicolon
at the end of a script.

  • fast/js/no-semi-insertion-at-end-of-script-expected.txt: Added.
  • fast/js/no-semi-insertion-at-end-of-script.html: Added.
  • fast/js/script-tests/no-semi-insertion-at-end-of-script.js: Added.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/parser/Lexer.cpp

    r62849 r62862  
    481481    int startOffset = currentOffset();
    482482
    483     if (UNLIKELY(m_current == -1)) {
    484         if (!m_terminator && !m_delimited && !m_isReparsing) {
    485             // automatic semicolon insertion if program incomplete
    486             goto doneSemicolon;
    487         }
     483    if (UNLIKELY(m_current == -1))
    488484        return 0;
    489     }
    490485
    491486    m_delimited = false;
Note: See TracChangeset for help on using the changeset viewer.