Ignore:
Timestamp:
Aug 10, 2014, 1:07:34 PM (11 years ago)
Author:
[email protected]
Message:

JSC Lexer is allowing octals 08 and 09 in strict mode functions
https://bugs.webkit.org/show_bug.cgi?id=135704

Patch by Diego Pino Garcia <Diego Pino Garcia> on 2014-08-10
Reviewed by Oliver Hunt.

Return syntax error ("Decimal integer literals with a leading zero are
forbidden in strict mode") if a number starts with 0 and is followed
by a digit.

  • parser/Lexer.cpp:

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

File:
1 edited

Legend:

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

    r170079 r172380  
    16651665
    16661666        record8('0');
     1667        if (strictMode && isASCIIDigit(m_current)) {
     1668            m_lexErrorMessage = "Decimal integer literals with a leading zero are forbidden in strict mode";
     1669            token = INVALID_OCTAL_NUMBER_ERRORTOK;
     1670            goto returnError;
     1671        }
    16671672        if (isASCIIOctalDigit(m_current)) {
    16681673            if (parseOctal(tokenData->doubleValue)) {
    1669                 if (strictMode) {
    1670                     m_lexErrorMessage = "Octal escapes are forbidden in strict mode";
    1671                     token = INVALID_OCTAL_NUMBER_ERRORTOK;
    1672                     goto returnError;
    1673                 }
    16741674                token = NUMBER;
    16751675            }
Note: See TracChangeset for help on using the changeset viewer.