Repository navigation
Document options as record types; fail verify on Closure Compiler warnings - #23
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closure Compiler cannot parse dotted
@paramnames, so the Epom ad server, which minifiesdist/postscribe.jswith Closure, logs threeJSC_INVALID_PARAMwarnings on every start (options.tagSoupFix,options.selfCloseFix,options.autoFix).src/prescribe/fixedReadTokenFactory.jsandsrc/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.jsis byte-identical, and Closure's output fordist/postscribe.jsis the same before and after.npm run test:closure, now part ofnpm run verify:test/epom/ClosureCheck.javacompilesdist/postscribe.jsthrough 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 isgoogle-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 verifypasses in Chromium, Firefox and WebKit.Generated with Claude Code