Ignore:
Timestamp:
Jul 21, 2011, 10:24:24 PM (14 years ago)
Author:
[email protected]
Message:

https://bugs.webkit.org/show_bug.cgi?id=64875
Use of yield keyword is broken

Reviewed by Sam Weinig.

Source/JavaScriptCore:

  • parser/Lexer.cpp:

(JSC::Lexer::parseIdentifier):

  • The bug here is that a successful match of a RESERVED_IF_STRICT token from parseKeyword is being nullified back to IDENT. The problem is that in the case of IDENT matches parseKeyword should not move the lexer's input position, but in the case of RESERVED_IF_STRICT it has done so.

LayoutTests:

  • fast/js/reserved-words-as-property-expected.txt:
  • fast/js/script-tests/reserved-words-as-property.js:
    • Make this test more comprehensive, to cover future-reserved & non-reserved words.
File:
1 edited

Legend:

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

    r90265 r91553  
    434434    if ((remaining >= maxTokenLength) && !(lexType & IgnoreReservedWords)) {
    435435        JSTokenType keyword = parseKeyword<shouldCreateIdentifier>(tokenData);
    436         if (keyword != IDENT && (keyword != RESERVED_IF_STRICT || strictMode)) {
     436        if (keyword != IDENT) {
    437437            ASSERT((!shouldCreateIdentifier) || tokenData->ident);
    438             return keyword;
     438            return keyword == RESERVED_IF_STRICT && !strictMode ? IDENT : keyword;
    439439        }
    440440    }
Note: See TracChangeset for help on using the changeset viewer.