Simplify JS error to NSError API

Summary: No need to specify duplicative information.

Reviewed By: javache

Differential Revision: D3550805

fbshipit-source-id: b5abc3f1c74e26b4d4641c29fedba189cc46406e
This commit is contained in:
Adam Ernst 2016-07-13 08:19:37 -07:00 committed by Facebook Github Bot 3
parent f15031a374
commit 3b4120d595
2 changed files with 3 additions and 3 deletions

View File

@ -60,7 +60,7 @@ RCT_EXTERN NSString *const RCTJavaScriptContextCreatedNotification;
* If available, the error's userInfo property will contain the JS stacktrace under
* the RCTJSStackTraceKey key.
*/
- (NSError *)convertJSErrorToNSError:(JSValueRef)jsError context:(JSContextRef)context;
- (NSError *)errorForJSError:(JSValue *)jsError;
/**
* @experimental

View File

@ -238,9 +238,9 @@ static NSError *RCTNSErrorFromJSError(RCTJSCWrapper *jscWrapper, JSContextRef co
return [NSError errorWithDomain:RCTErrorDomain code:1 userInfo:errorInfo];
}
- (NSError *)convertJSErrorToNSError:(JSValueRef)jsError context:(JSContextRef)context
- (NSError *)errorForJSError:(JSValue *)jsError
{
return RCTNSErrorFromJSError(_jscWrapper, context, jsError);
return RCTNSErrorFromJSError(_jscWrapper, jsError.context.JSGlobalContextRef, jsError.JSValueRef);
}
#if RCT_DEV