文件历史

提交图

2 次代码提交

作者 SHA1 备注 提交日期
Sarath S Menon 3b5395947a fix(js): don't double-wrap IIFEs that contain return (#199)
The substring check `"return " in expression` incorrectly matched
expressions that already contained an IIFE with an internal return,
causing double-wrapping and a silent None result. Guard with
`not expression.strip().startswith("(")` so pre-wrapped expressions
pass through unchanged.

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-25 15:19:42 +05:30
Sarath S Menon 932347c7a2 fix(js): auto-wrap top-level return expressions in an IIFE (#187)
Agents naturally write js() calls with top-level `return`, which is a
syntax error in Runtime.evaluate. js() now detects `return ` and wraps
the expression in an IIFE so both styles work without callers needing
to know the CDP constraint.

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-24 15:48:19 +05:30