3 ms·
LiteralParser 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 directl
by sillysaurus3 9y ago
LiteralParser 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.