Skip to content

JavaScript/TypeScript: hashbang #! and Annex B HTML-like <!-- / --> comments are not stripped, commented code counts in every keyword family #9451

Backlog

Description

@squid-protocol

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.

  1. 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.
  2. 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

  1. added
    bug
    on Nov 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions