Ignore:
Timestamp:
Jun 10, 2015, 9:43:13 AM (10 years ago)
Author:
[email protected]
Message:

Unreviewed, rolling out r185414.
https://bugs.webkit.org/show_bug.cgi?id=145844

broke debug and jsc tests (Requested by alexchristensen on
#webkit).

Reverted changeset:

"JavaScript: Drop the “escaped reserved words as identifiers”
compatibility measure"
https://bugs.webkit.org/show_bug.cgi?id=90678
http://trac.webkit.org/changeset/185414

File:
1 edited

Legend:

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

    r185414 r185419  
    10411041template<typename CharacterType> template<bool shouldCreateIdentifier> JSTokenType Lexer<CharacterType>::parseIdentifierSlowCase(JSTokenData* tokenData, unsigned lexerFlags, bool strictMode)
    10421042{
     1043    const ptrdiff_t remaining = m_codeEnd - m_code;
    10431044    auto identifierStart = currentSourcePtr();
    10441045    bool bufferRequired = false;
     
    10861087        tokenData->ident = nullptr;
    10871088
    1088     if (LIKELY(!(lexerFlags & LexerFlagsIgnoreReservedWords))) {
     1089    if (LIKELY(!bufferRequired && !(lexerFlags & LexerFlagsIgnoreReservedWords))) {
    10891090        ASSERT(shouldCreateIdentifier);
    1090         const HashTableValue* entry = m_vm->keywords->getKeyword(*ident);
    1091         if (!entry)
    1092             return IDENT;
    1093         JSTokenType token = static_cast<JSTokenType>(entry->lexerValue());
    1094         return (token != RESERVED_IF_STRICT) || strictMode ? token : IDENT;
     1091        // Keywords must not be recognized if there was an \uXXXX in the identifier.
     1092        if (remaining < maxTokenLength) {
     1093            const HashTableValue* entry = m_vm->keywords->getKeyword(*ident);
     1094            ASSERT((remaining < maxTokenLength) || !entry);
     1095            if (!entry)
     1096                return IDENT;
     1097            JSTokenType token = static_cast<JSTokenType>(entry->lexerValue());
     1098            return (token != RESERVED_IF_STRICT) || strictMode ? token : IDENT;
     1099        }
     1100        return IDENT;
    10951101    }
    10961102
Note: See TracChangeset for help on using the changeset viewer.