Skip to content

fix: accept trailing semicolons in evaluate_script - #2782

Closed
kevin9327 wants to merge 1 commit into
ChromeDevTools:mainfrom
kevin9327:fix/evaluate-script-trailing-semicolon
Closed

kevin9327 wants to merge 1 commit into
ChromeDevTools:mainfrom
kevin9327:fix/evaluate-script-trailing-semicolon

Conversation

@kevin9327

Copy link
Copy Markdown
Contributor

Summary

evaluate_script wraps the function source as (${fnString}). A trailing semicolon — which agents often add — makes (() => 1;) a SyntaxError, so a valid function declaration fails.

Strip trailing semicolons before wrapping.

Testing

  • npm run test tests/tools/script.test.ts
  • npm run typecheck
  • npm run check-format

AI-assisted (Grok)

@google-cla

google-cla Bot commented Sep 20, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@OrKoN

OrKoN commented Oct 1, 2026

Copy link
Copy Markdown
Collaborator

Closing as stale (also I think it might have been fixed on main)

@OrKoN OrKoN closed this Oct 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants