-
Notifications
You must be signed in to change notification settings - Fork 4
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
mv try catch out of main function #3
Conversation
Looks good. |
Done. |
var json; | ||
|
||
if (!error) | ||
error = tryit(function() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
error =
is not needed since tryit
doesn't return any values.
https://github.com/HenrikJoreteg/tryit/blob/master/tryit.js
Done. |
Hi all, sorry for late reply. I saw this PR before but didn't know how to respond as it's doing multiple things in one PR and I'm not sure what you mean by;
Does it have a bug that I'm not realizing ? Or are you just moving try-catch for optimization ? |
It's done with try-call module now; https://github.com/azer/read-json/blob/master/index.js#L14 |
Moved
try-catch
to another function to improve speed.Callback called twice when error occur:
error
undefined
Optimization killers