Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should js* always render ~{} with :context :expr ? #350

Closed
borkdude opened this issue Oct 28, 2023 · 0 comments
Closed

Should js* always render ~{} with :context :expr ? #350

borkdude opened this issue Oct 28, 2023 · 0 comments
Assignees

Comments

@borkdude
Copy link
Member

borkdude commented Oct 28, 2023

E.g. what CLJS does is wrap return around the result of js*, NOT pass the :return context to js*!

cljs.user=> (str (fn [] (prn 1) (js* "~{} ~{}" 1 2)))
"function (){\ncljs.core.prn.call(null,(1));\n\nreturn (1) (2);\n}"

https://github.com/clojure/clojurescript/blob/067eaef03678a06d83caf3f66ddf20f9ee71db5b/src/main/clojure/cljs/analyzer.cljc#L3669-L3718

The answer seems to be yes:

https://github.com/clojure/clojurescript/blob/067eaef03678a06d83caf3f66ddf20f9ee71db5b/src/main/clojure/cljs/analyzer.cljc#L3670

@borkdude borkdude self-assigned this Oct 28, 2023
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

No branches or pull requests

1 participant