You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
JavaScript/TypeScript: hashbang #! and Annex B HTML-like <!-- / --> comments are not stripped, commented code counts in every keyword family #9451
Found by the SOP-002 gap-cell decoy suite (protocol SOP-002-v1, epic #8863).
Construct: two comment forms that the ECMAScript specification defines are not stripped by Prism for JavaScript/TypeScript, so their text counts as code in every keyword family.
Hashbang comment (ECMAScript 2023, HashbangComment; also accepted by TypeScript): #! on the first line of a source file is a comment to the end of that line.
Annex B HTML-like comments (JavaScript script goal only; TypeScript does not accept them): <!-- begins a comment to the end of the line, and --> at the start of a line (after optional whitespace / block comments) does too.
Snippets (family telemetry, both languages for 1, javascript only for 2):
#!/usr/bin/env node logger.info("x")\nconst a = 1;\n
<!-- logger.info("x")\n
--> logger.info("x")\n
Expected: 0 telemetry hits (the text is a comment). Actual: 1 hit each. The same happens for every family tested (cryptography, llm_api, rce_funnel, ...).
Lexer: gitgalaxy/core/prism.py comment handling for javascript / typescript. Real-world impact of the hashbang form is the #!/usr/bin/env node first line of every CLI script reaching the code stream.
Locked in tests/decoys/test_decoy_javascript.py and tests/decoys/test_decoy_typescript.py as xfail(strict=True).
Activity
tests/decoys: SOP-002 gap-cell decoy suites for python, typescript, j…