mirror of
https://github.com/affaan-m/ECC.git
synced 2026-09-18 15:50:25 +02:00
The documentation surface test scanned the hook's raw source with two regexes. That had two holes, both confirmed against the shipped parser: - a GATEGUARD_* name appearing only in a comment or a string was counted as a real read, and - destructured, aliased and computed reads were invisible, so an undocumented knob added in one of those forms would pass silently. Blank comments, string literals, template-literal text and regex literals before scanning, so only real code contributes. Blanking preserves length, so `process.env[...]` keys are located in the blanked code and read back from the raw source at the same offset. Rather than chase every possible access form with regexes, the supported forms are now enforced: destructuring, aliasing, spreading, enumerating and computed keys fail the guard with instructions to either keep the convention or extend the parser. Six self-checks cover the blanker and the guard, including a regex literal containing a slash. Refs #2573