Currently calling (enable-console-print!) causes a bunch of code to be retained in :advanced mode even if you never print.
While that is not ideal it doesn't cause runtime errors. Not calling it and trying to print however will throw an exception which will potentially break your app.
So we end up in a no-win situation for :advanced builds where a "forgotten" prn may break your app in production or "maybe" bloating your file size by retaining all the print-related things.
I think the no-print-fn condition should never throw, maybe just try to write a warning using console.log. Or just dropping the prn altogether.
The attached CLJS-2002.patch moves the throw to string-print and using nil as the init for the two Vars solves CLJS-2231. But it doesn't address the ticket as written: Leaving an inadvertent prn in your code leads to a call to string-print which throws.
David Nolen July 14, 2017 at 2:29 AM
Let's move the old behavior to `string-print` only.
Currently calling
(enable-console-print!)
causes a bunch of code to be retained in :advanced mode even if you never print.While that is not ideal it doesn't cause runtime errors. Not calling it and trying to print however will throw an exception which will potentially break your app.
So we end up in a no-win situation for :advanced builds where a "forgotten"
prn
may break your app in production or "maybe" bloating your file size by retaining all the print-related things.I think the no-print-fn condition should never throw, maybe just try to write a warning using console.log. Or just dropping the
prn
altogether.