Abstract
A method is disclosed for syntax-checking JavaScript that no compiler, linter or per-file syntax check reads: program source carried as literal block values inside a deployment manifest, inline script elements of HTML documents carried the same way, and script elements that a server program emits from inside its own string or template literals. A textual slicer extracts each block value with its manifest line, and a comment-aware scanner extracts each inline script with its type and line. Every unit receives an authoritative parse under the goal the gate assigns from its key's extension or its element's type, and any error fails the unit. A script-goal unit that passed is parsed again under the module goal, and from that probe only redeclaration errors are reported. Because top-level function declarations are lexically scoped in a module but variable-scoped in a script, a duplicated top-level function, or a function sharing a top-level name with a variable, is silently tolerated in a classic script but is an early error in a module, so the goal asymmetry detects a defect that a clean line-based merge produces. Emitted scripts are first unescaped with the literal escape-sequence rules, so the parser sees approximately the text a browser receives. Findings map to manifest lines, a run that checked nothing fails, and the scanner and parse harness are shared with a second gate over statically served pages.
Creative Commons License

This work is licensed under a Creative Commons Attribution 4.0 License.
Recommended Citation
Assuncao, gustavo matthew, "Dual-Goal Parse Gate for Code Embedded in Deployment Manifests: Runtime-Goal Authoritative Parse, Module-Goal Redeclaration Probe, and Literal-Unescaped Parsing of Emitted Scripts", Technical Disclosure Commons, ()
https://www.tdcommons.org/dpubs_series/13227