Skip to content

🐛 fix(js): pass member dot at end of input through - #2287

Merged
gaborbernat merged 1 commit into
tox-dev:mainfrom
gaborbernat:fix/js-eof-member-pass-through
Nov 16, 2026
Merged

gaborbernat merged 1 commit into
tox-dev:mainfrom
gaborbernat:fix/js-eof-member-pass-through

Conversation

@gaborbernat

Copy link
Copy Markdown
Member

#2275 made minify_js() refuse a string, template or regex token where a property name is required, and it also refused the end of input in that position. Input that ends right after a member dot, such as t,(0)., then raised ValueError where it was passed through unchanged, and tests/js/test_minify.py::test_minify_keeps_trailing_dot_after_numeric_member fails on main. Fixes #2285.

The name check in leaf() (parser.c) accepted only an identifier name or a private name. The end of input has no text and repeats no earlier name, so the check lets it through again, as it did before #2275. A string, number, template or regex token after the dot is still refused.

The fix is unreleased: the input's behaviour in the last release is unchanged.

Refusing a literal token as a property name also refused the end of input in
that position, so input such as `t,(0).` raised an error where it was passed
through unchanged. The end of input has no text and repeats no earlier name,
so the parser lets it through again, as it did before that change.

Fixes tox-dev#2285
@gaborbernat gaborbernat added the bug Something isn't working label Nov 16, 2026
@gaborbernat
gaborbernat merged commit 2a3c267 into tox-dev:main Nov 16, 2026
2 of 48 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🐛 fix(js): pass a member dot at end of input through

1 participant