Ignore:
Timestamp:
Jun 3, 2011, 11:15:43 PM (14 years ago)
Author:
[email protected]
Message:

2011-06-03 Oliver Hunt <[email protected]>

Reviewed by Maciej Stachowiak.

Lexer needs to provide Identifier for reserved words
https://bugs.webkit.org/show_bug.cgi?id=62086

Alas it is necessary to provide an Identifier reference for keywords
so that we can do the right thing when they're used in object literals.
We now keep Identifiers for all reserved words in the CommonIdentifiers
structure so that we can access them without a hash lookup.

  • KeywordLookupGenerator.py:
  • parser/Lexer.cpp: (JSC::Lexer::parseIdentifier):
  • parser/Lexer.h:
  • runtime/CommonIdentifiers.cpp: (JSC::CommonIdentifiers::CommonIdentifiers):
  • runtime/CommonIdentifiers.h:
File:
1 edited

Legend:

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

    r88083 r88094  
    415415    const ptrdiff_t remaining = m_codeEnd - m_code;
    416416    if ((remaining >= maxTokenLength) && !(lexType & IgnoreReservedWords)) {
    417         JSTokenType keyword = parseKeyword();
    418         if (keyword != IDENT)
     417        JSTokenType keyword = parseKeyword<shouldCreateIdentifier>(lvalp);
     418        if (keyword != IDENT) {
     419            ASSERT((!shouldCreateIdentifier) || lvalp->ident);
    419420            return keyword;
     421        }
    420422    }
    421423    const UChar* identifierStart = currentCharacter();
Note: See TracChangeset for help on using the changeset viewer.