js_of_ocaml icon indicating copy to clipboard operation
js_of_ocaml copied to clipboard

[FEATURE REQUEST] enable with-js-error by default?

Open Lupus opened this issue 5 years ago • 2 comments

Are there any caveats for enabling with-js-error optimization by default? According to this SO answer perf hit for capturing the stack is quite affordable. It's quite hard to debug exceptions without backtraces and dune currently gives no option to enable this flag globally.

Lupus avatar Jul 28 '20 11:07 Lupus

Or maybe the behavior could be changed to match that of OCAMLRUNPARAM=b, i.e. always call some hook during exception throwing, and have it determine if new Error() needs to be created based on some property of environment (if we're running on node.js, we could parse OCAMLRUNPARAM environment variable, not sure what would be the best way to toggle this flag in browser, read some key from local storage?).

Lupus avatar Jul 30 '20 11:07 Lupus

xref #1071

hhugo avatar Nov 12 '20 09:11 hhugo