Details
-
Type:
Enhancement
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: None
-
Labels:None
-
Patch:Code
Description
As mentioned here: https://groups.google.com/forum/?fromgroups=#!topic/clojurescript/ZX6M4KXx8I8
Naming every fn in the compiled javascript functions makes it a little easier to find out whats going on when looking at a stacktrace. This patch names every function generated as fn_<ns>/<orig-name>_<line>. See example stacktrace in the discussion above.
The optional cljs snippet (https://gist.github.com/thheller/4972200) then also transforms this data and prints functions as
(pr-str name)
=> #<function cljs.core/name line:5876>
instead of dumping the javascript source on you.
The .patch has the drawback that the generated source size grows a bit (about 10% on my codebase), but advanced compilation takes care of that (although even that is still a bit larger, the closure compiler doesnt seem to strip unused function names). One could make this a compiler option if the size differences are too big.