Changeset 221400 in webkit
- Timestamp:
- Aug 30, 2017 3:27:09 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JSTests/ChangeLog
r221358 r221400 1 2017-08-30 Saam Barati <sbarati@apple.com> 2 3 semicolon is being interpreted as an = in the LiteralParser 4 https://bugs.webkit.org/show_bug.cgi?id=176114 5 6 Reviewed by Oliver Hunt. 7 8 * stress/jsonp-literal-parser-semicolon-is-not-assignment.js: Added. 9 * stress/resources/literal-parser-test-case.js: Added. 10 1 11 2017-08-30 Oleksandr Skachkov <gskachkov@gmail.com> 2 12 -
trunk/Source/JavaScriptCore/ChangeLog
r221384 r221400 1 2017-08-30 Saam Barati <sbarati@apple.com> 2 3 semicolon is being interpreted as an = in the LiteralParser 4 https://bugs.webkit.org/show_bug.cgi?id=176114 5 6 Reviewed by Oliver Hunt. 7 8 When lexing a semicolon in the LiteralParser, we were properly 9 setting the TokenType on the current token, however, we were 10 *returning* the wrong TokenType. The lex function both returns 11 the TokenType and sets it on the current token. Semicolon was 12 setting the TokenType to semicolon, but returning the TokenType 13 for '='. This caused programs like `x;123` to be interpreted as 14 `x=123`. 15 16 * runtime/LiteralParser.cpp: 17 (JSC::LiteralParser<CharType>::Lexer::lex): 18 (JSC::LiteralParser<CharType>::Lexer::next): 19 1 20 2017-08-22 Filip Pizlo <fpizlo@apple.com> 2 21 -
trunk/Source/JavaScriptCore/runtime/LiteralParser.cpp
r208985 r221400 273 273 token.type = TokSemi; 274 274 token.end = ++m_ptr; 275 return Tok Assign;275 return TokSemi; 276 276 } 277 277 if (isASCIIAlpha(*m_ptr) || *m_ptr == '_' || *m_ptr == '$') … … 318 318 TokenType LiteralParser<CharType>::Lexer::next() 319 319 { 320 TokenType result; 320 321 if (m_mode == NonStrictJSON) 321 return lex<NonStrictJSON>(m_currentToken); 322 if (m_mode == JSONP) 323 return lex<JSONP>(m_currentToken); 324 return lex<StrictJSON>(m_currentToken); 322 result = lex<NonStrictJSON>(m_currentToken); 323 else if (m_mode == JSONP) 324 result = lex<JSONP>(m_currentToken); 325 else 326 result = lex<StrictJSON>(m_currentToken); 327 ASSERT(m_currentToken.type == result); 328 return result; 325 329 } 326 330
Note: See TracChangeset
for help on using the changeset viewer.