-
-
Couldn't load subscription status.
- Fork 58
feat: throw a dedicated instance of MelangeError instead of Error
#1043
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
Conversation
|
Ideally we could generate something like this and the MelangeError class would build the object. This would both make the code more readable and decrease bundle size. throw new Caml_js_exceptions.MelangeError("Assert_failure", [
"jscomp/test/fun_pattern_match.ml",
41,
9
]); |
|
We can make that change, but I'm not too concerned about bundle size, to be honest. I suspect results after gzipping will be negligible. |
|
@anmonteiro my main issue with bundling time is parsing time, the network overhead is likely negligible but starting time is always nice to be improved and code reuse also makes engines heat up. |
|
the only thing you're saving is the extra {
_1: 42,
_2: 'string1',
_3: 'string2'
}We can avoid generating an extra |
fix: runtime tests, everything working now fix: blackbox-tests refactor: Js_dump.new_error
3844191 to
8ba7775
Compare
new Error(ID, {cause: CAML_EXN})for exceptions #1036 to throw a custom instance ofErrorthat we only use inside Melange,MelangeErrorfixes #1042