Skip to content

Conversation

@joshuamiller
Copy link
Contributor

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:

goog.log.Level = class Level { constructor() ... }
file_$Users$myuser$_m2$repository$org$clojure$google_closure_library$0_0_20201211_3e6c510d$google_closure_library_0_0_20201211_3e6c510d_jar!$goog$log$log$classdecl$var0 = function(name, value) { ...

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.

@mhausner
Copy link
Contributor

Chinthoorie, can you please accept this PR?

@frost-cy frost-cy merged commit 859f56e into google:master Aug 14, 2024
copybara-service bot pushed a commit that referenced this pull request Aug 14, 2024
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.

3 participants