ios-jsc
ios-jsc copied to clipboard
[Known Issue] Native methods throwing Objective-C exceptions crash on Simulator when called from JavaScript
Environment
Provide version numbers for the following components (information can be retrieved by running tns info in your project folder or by inspecting the package.json of the project):
- iOS Runtime: 5.2.0-2018-12-28-111556-01
Describe the bug App crashes when calling a native function which throws an Objective-C exception from JavaScript, because of libffi's missing support for stack unwinding on iOS Simulator.
To Reproduce Execute an app containing the following code on a Simulator:
try {
NSArray.alloc().init().objectAtIndex(3);
} catch (e) {
console.log("Caught error: ", e);
}
=> app crashes
Expected behavior The exception should be caught and logged and program execution should continue. It works as expected on actual devices.