mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-10 09:02:14 +02:00
The parser previously detected direct eval() calls at the end of parse_expression(), by checking if the final expression was a CallExpression with "eval" as the callee. This missed cases where eval() appeared as a subexpression, e.g. `eval(code) | 0`, since the final expression would be a BinaryExpression, not a CallExpression. Move the detection into parse_call_expression() where the CallExpression is actually created. This ensures we always set the contains_direct_call_to_eval flag regardless of surrounding operators, so local variables are correctly placed in the declarative environment where eval'd code can find them.
236 KiB
236 KiB