3 ms·
Safari Accidentally Treating ';' as an Assignment Operator
- fagnerbrack 9y agoRelevant https://twitter.com/RReverser/status/902504540393660416 https://twitter.com/RReverser/status/902504540393660416
- sillysaurus3 9y agoLiteralParser is used for JSON and for JSONP. To do JSONP quickly we have magic logic to handle (a(.b)=json | a(.b)\(json\))+ which we parse and call directly to avoid jumping through the interpreter. We need this because people still insist on sending megs of data as executable script. because reasons. This is hilarious. > This code looks suspicious inside the lex() function: if (*m_ptr == ';') { token.type = TokSemi; token.end = ++m_ptr; return TokAssign; } that does indeed seem questionable. I'm so sad I wrote it :( Know that feeling.
- wahern 9y agoPart of the patch does - return TokAssign; + return TokSemi; but that commits the same original sin. The better fix is + return token.type; OTOH, if _all_ the other code were using the same poor pattern I could understand not wanting to fix it properly, at least in an initial patch.