NativeScript / ios-jsc

NativeScript for iOS using JavaScriptCore

Home Page:http://docs.nativescript.org/runtimes/ios

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Known Issue] Native methods throwing Objective-C exceptions crash on Simulator when called from JavaScript

mbektchiev opened this issue · comments

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.