Skip to content

Document options as record types; fail verify on Closure Compiler warnings - #23

Merged
ruin merged 2 commits into
masterfrom
fix/closure-jsdoc
Oct 29, 2026
Merged

ruin merged 2 commits into
masterfrom
fix/closure-jsdoc

Conversation

@ruin

@ruin ruin commented Oct 29, 2026

Copy link
Copy Markdown
Member

Closure Compiler cannot parse dotted @param names, so the Epom ad server, which minifies dist/postscribe.js with Closure, logs three JSC_INVALID_PARAM warnings on every start (options.tagSoupFix, options.selfCloseFix, options.autoFix).

  • src/prescribe/fixedReadTokenFactory.js and src/prescribe/HtmlParser.js: the options are documented as record types, e.g. @param {{autoFix: (boolean|undefined)}=} options, with the per-option prose kept in the description. Comments only: dist/postscribe.min.js is byte-identical, and Closure's output for dist/postscribe.js is the same before and after.
  • npm run test:closure, now part of npm run verify: test/epom/ClosureCheck.java compiles dist/postscribe.js through Closure's Java API with the server's options (SIMPLE_OPTIMIZATIONS, ECMASCRIPT_NEXT in, ECMASCRIPT5 out, empty externs) and fails on any warning or error. It uses the Java API because the command line with the same flags does not report these warnings. The jar is google-closure-compiler-java, pinned to 20240317 (the server's version). CI installs JDK 21 for it in both workflows.

The check fails on master's dist (3 warnings) and passes on this branch. npm run verify passes in Chromium, Firefox and WebKit.

Generated with Claude Code

epomrnd and others added 2 commits October 29, 2026 15:20
Closure rejects dotted @PARAM names (options.tagSoupFix, options.selfCloseFix,
options.autoFix) with JSC_INVALID_PARAM, and the Epom ad server, which
minifies dist/postscribe.js with Closure, logged all three on every start.
Comments only: postscribe.min.js is byte-identical and Closure's output for
postscribe.js is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
test/epom/ClosureCheck.java compiles the file through Closure's Java API with
the options the Epom ad server uses for its loader (SIMPLE_OPTIMIZATIONS,
ECMASCRIPT_NEXT in, ECMASCRIPT5 out, empty externs) and exits non-zero on any
warning or error. The API, not the command line: the CLI with the same flags
does not report the JSC_INVALID_PARAM warnings the server logs. The jar is
google-closure-compiler-java pinned to 20240317, the server's version; CI
gets a JDK 21 for it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ruin
ruin merged commit 9058c36 into master Oct 29, 2026
1 check passed
@ruin
ruin deleted the fix/closure-jsdoc branch October 29, 2026 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants