Replace ! in filenames when converting to JS identifiers #4185
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.
When using Closure to emit ES5 code for ClojureScript, the source filename of the input code can be in a jar, such as
file:/Users/myuser/.m2/repository/org/clojure/google-closure-library/0.0-20230227-c7c0a541/google-closure-library-0.0-20230227-c7c0a541.jar!goog/log/log.js. The!is not replaced when converting this filename to a JS identifier, resulting in the following input/output pair:Note that the variable name has
!in it, which does not parse.This PR adds
!to the list of special characters to replace so that jar-sourced input files can produce legal ES5 output.