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: a regex literal containing \/\/ (/^https?:\/\//) is read as a // comment, code after it on the line is lost #9452
Found by the SOP-002 gap-cell decoy suite (protocol SOP-002-v1, epic #8863).
Construct: a regular-expression literal that contains an escaped slash pair, /^https?:\/\//. Prism reads the // inside the regex literal as the start of a line comment, so the rest of the line is moved to the comment stream and real code after the literal is lost (recall loss in every family on that line).
Snippet (javascript and typescript, family telemetry):if (/^https?:\/\//.test(u)) logger.info("x");
Expected: 1 telemetry hit (the logger call is code). Actual: 0 hits. const r = /a/; logger.info("x") gives 1, and moving the call to the next line gives 1, so only the remainder of the line after the regex literal is lost.
This is the regex-literal twin of the string-to-comment boundary ("http://x" // kw), which passes. Matching a URL scheme with /^https?:\/\// is a common idiom.
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…