-
Notifications
You must be signed in to change notification settings - Fork 662
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
Global scoped try/catch emits compilation error #537
Comments
You can perhaps try deleting pieces of the code in order to figure out which parts are actually making things fail. If you build Hermes with debug information (https://github.com/facebook/hermes/blob/master/doc/BuildingAndRunning.md) then you can also attach a debugger and breakpoint on the error message (it's in lib/BCGen/Exceptions.cpp) in order to look at the stacktrace and perhaps help figure out how you can find a useful repro we can take a look at. |
@avp Thank you! There is a gist that throws the same exception https://gist.github.com/Ferossgp/c4107f30bb686f56c5f2893541838eda I will try to create a reproduction without so many try/catch'es too. Basically what I've found is that this code:
also decreases the |
Thanks for the reproduction. We'll take a look and see what has to be done to avoid hitting this case in the wrong circumstances. |
Great, thanks for confirming! |
I've been trying to compile an app bundle generated by Closure Compiler.
Compiling the bundle with the Hermes compiler:
emits the following error:
Hermes versions tested with:
By inspecting the JS code I found that the reason is the presence of a try/catch in the global scope. The
try/catch
does not have any recursion and deep function traces inside its scope. Removing it solves the error.Adding this
try {} catch (a) {}
at the end of file, also causes the error.Seems like there is something else in the bundle that in combination with a global try/catch causes the error.
In a simple test project, the error is not reproducible. I want to create a repro thus I would like to know some hints for the direction to dig in.
The text was updated successfully, but these errors were encountered: