From 3b4120d5953f6fc3d3b5209c1ac8bb18df55e89c Mon Sep 17 00:00:00 2001 From: Adam Ernst Date: Wed, 13 Jul 2016 08:19:37 -0700 Subject: [PATCH] Simplify JS error to NSError API Summary: No need to specify duplicative information. Reviewed By: javache Differential Revision: D3550805 fbshipit-source-id: b5abc3f1c74e26b4d4641c29fedba189cc46406e --- React/Executors/RCTJSCExecutor.h | 2 +- React/Executors/RCTJSCExecutor.mm | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/React/Executors/RCTJSCExecutor.h b/React/Executors/RCTJSCExecutor.h index 11932c1d8..447f39d03 100644 --- a/React/Executors/RCTJSCExecutor.h +++ b/React/Executors/RCTJSCExecutor.h @@ -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 diff --git a/React/Executors/RCTJSCExecutor.mm b/React/Executors/RCTJSCExecutor.mm index deab6281e..cd32ae19f 100644 --- a/React/Executors/RCTJSCExecutor.mm +++ b/React/Executors/RCTJSCExecutor.mm @@ -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