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

goog/string/string.js reported as string.cljs #624

Closed
mfikes opened this issue Feb 5, 2018 · 3 comments
Closed

goog/string/string.js reported as string.cljs #624

mfikes opened this issue Feb 5, 2018 · 3 comments
Labels

Comments

@mfikes
Copy link
Member

mfikes commented Feb 5, 2018

cljs.user=> (clojure.string/trimr 2)
str.replace is not a function. (In 'str.replace(/[\s\xa0]+$/, '')', 'str.replace' is undefined)
	trimRight (goog/string/string.cljs:367:21)
	clojure.string/trimr (clojure/string.cljs:180:4)
@mfikes mfikes changed the title string.js reported as string.cljs goog/string/string.js reported as string.cljs Feb 5, 2018
@anmonteiro
Copy link
Contributor

I wouldn't be surprised if this were an upstream issue.

@mfikes
Copy link
Member Author

mfikes commented Feb 10, 2018

Yes, this does appear to be upstream. In JVM-based REPLs the source mapping code takes a look at the .map file on disk and gleans some information on the original filename, but for self-hosted, we end up using the code directly in the cljs.stacktrace namespace where it blindly assumes all JavaScript files are produced from .cljs sources.

With the attached experimental patch, the behavior changes to

cljs.user=> (clojure.string/trimr 2)
str.replace is not a function. (In 'str.replace(/[\s\xa0]+$/, '')', 'str.replace' is undefined)
	trimRight (goog/string/string.js:367:21)
	clojure.string/trimr (clojure/string.cljs:209:4)

0001-Only-rename-to-.cljs-if-mapped.txt

@mfikes
Copy link
Member Author

mfikes commented Feb 11, 2018

There doesn't appear to be a decent way to fix this upstream. For now, just having Planck check whether the a .cljs file exists before assuming that the source was originally .cljs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants