Error handling for concrete JS executor

Reviewed By: adamjernst

Differential Revision: D3235189

fb-gh-sync-id: a6d545a6b0b388c52305e2936371776d579460cd
fbshipit-source-id: a6d545a6b0b388c52305e2936371776d579460cd
This commit is contained in:
Pieter De Baets 2016-04-28 13:41:55 -07:00 коммит произвёл Facebook Github Bot 9
Родитель 41e89b4129
Коммит 26d0ce929f
2 изменённых файлов: 9 добавлений и 1 удалений

Просмотреть файл

@ -25,6 +25,14 @@ RCT_EXTERN NSString *const RCTJSCThreadName;
*/ */
RCT_EXTERN NSString *const RCTJavaScriptContextCreatedNotification; RCT_EXTERN NSString *const RCTJavaScriptContextCreatedNotification;
/**
* Create a NSError from a JSError object.
*
* If available, the error's userInfo property will contain the JS stacktrace under
* the RCTJSStackTraceKey key.
*/
RCT_EXTERN NSError *RCTNSErrorFromJSError(JSContextRef context, JSValueRef jsError);
/** /**
* Uses a JavaScriptCore context as the execution engine. * Uses a JavaScriptCore context as the execution engine.
*/ */

Просмотреть файл

@ -144,7 +144,7 @@ static NSString *RCTJSValueToJSONString(JSContextRef context, JSValueRef value,
return (__bridge_transfer NSString *)string; return (__bridge_transfer NSString *)string;
} }
static NSError *RCTNSErrorFromJSError(JSContextRef context, JSValueRef jsError) NSError *RCTNSErrorFromJSError(JSContextRef context, JSValueRef jsError)
{ {
NSMutableDictionary *errorInfo = [NSMutableDictionary new]; NSMutableDictionary *errorInfo = [NSMutableDictionary new];