]> git.kaiwu.me - njs.git/commit
Parser: remove the dead cover parenthesized production
authorDmitry Volyntsev <xeioex@nginx.com>
Tue, 1 Sep 2026 04:49:27 +0000 (21:49 -0700)
committerDmitry Volyntsev <xeioexception@gmail.com>
Fri, 4 Sep 2026 20:56:37 +0000 (13:56 -0700)
commit35744a3ec85c2fe91d17e17c50d64ce5dd651f1c
tree60b24940d1b918b8c6a80ba62a0e85c4e74e6044
parentcdfda468b1c05df3a4aea3dd6b894ee45142175f
Parser: remove the dead cover parenthesized production

Previously, njs_parser_cover_parenthesized_expression(), its two
continuations and njs_parser_binding_identifier_pattern() formed a closed
island: every reference to them came from inside it, and the only thing
linking it to the parser was a "(void)" cast left with a TODO in 2020.  It
honours neither contract this series introduces.  Two of its states are
reject landing states that never inspected parser->ret, so with a ")" or a
"," in hand they would consume the token and pop the stack after a reject.
Its parenthesized expression opens no [+In] region.

The fix is to delete the island rather than repair it.  Arrow parameters are
not going to be completed through this production, and the binding pattern
entry points it dispatched to are stubs reachable on their own.
src/njs_parser.c