Skip to content

javascript func_start/args parse 'with (x) {}' as a function named 'with' #2539

Closed

Description

@squid-protocol

Summary

Found by the #1096 control corpus (javascript reference folder): with (shape) {} is
counted by javascript func_start (and args) as a function named with.

Evidence

data/javascript/b.js has exactly 3 function declarations plus one with (shape) {}
statement; observed func_start = 4 / args = 4. finditer on the func_start rule returns
['function probeBypass', 'with', 'function probeTelemetry', 'function probeState'].

Cause

The identifier (args) { alternation excludes if|for|while|switch|catch|return but not
with (nor do). switch (flag) {} in the same corpus is correctly excluded; with just
isn't in the list.

Fix shape

Add with (and audit for other statement keywords that can precede (...) { — do can't,
but dialect keywords might) to the exclusion in both the func_start and args alternations.
Low blast radius; strict-mode code can't even use with, so real-corpus impact is small
but the fix is cheap and the tri-comparison ledger precedent says exclusions belong in the
regex, not in verdicts.

References

Activity

  1. added
    core-engine
    on Aug 31, 2026
  2. added 2 commits that reference this issue on Sep 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    core-engine

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions