Changeset 89109 in webkit for trunk/Source/JavaScriptCore/parser/Lexer.cpp
- Timestamp:
- Jun 16, 2011, 8:17:11 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/parser/Lexer.cpp
r89100 r89109 406 406 } 407 407 408 template <bool shouldCreateIdentifier> ALWAYS_INLINE JSTokenType Lexer::parseIdentifier(JSTokenData* tokenData, unsigned lexType )408 template <bool shouldCreateIdentifier> ALWAYS_INLINE JSTokenType Lexer::parseIdentifier(JSTokenData* tokenData, unsigned lexType, bool strictMode) 409 409 { 410 410 const ptrdiff_t remaining = m_codeEnd - m_code; 411 411 if ((remaining >= maxTokenLength) && !(lexType & IgnoreReservedWords)) { 412 412 JSTokenType keyword = parseKeyword<shouldCreateIdentifier>(tokenData); 413 if (keyword != IDENT ) {413 if (keyword != IDENT && (keyword != RESERVED_IF_STRICT || strictMode)) { 414 414 ASSERT((!shouldCreateIdentifier) || tokenData->ident); 415 415 return keyword; … … 470 470 const HashEntry* entry = m_keywordTable.entry(m_globalData, *ident); 471 471 ASSERT((remaining < maxTokenLength) || !entry); 472 return entry ? static_cast<JSTokenType>(entry->lexerValue()) : IDENT; 472 if (!entry) 473 return IDENT; 474 JSTokenType token = static_cast<JSTokenType>(entry->lexerValue()); 475 return (token != RESERVED_IF_STRICT) || strictMode ? token : IDENT; 473 476 } 474 477 return IDENT; … … 1083 1086 case CharacterBackSlash: 1084 1087 if (lexType & DontBuildKeywords) 1085 token = parseIdentifier<false>(tokenData, lexType );1088 token = parseIdentifier<false>(tokenData, lexType, strictMode); 1086 1089 else 1087 token = parseIdentifier<true>(tokenData, lexType );1090 token = parseIdentifier<true>(tokenData, lexType, strictMode); 1088 1091 break; 1089 1092 case CharacterLineTerminator:
Note:
See TracChangeset
for help on using the changeset viewer.