mirror of
https://github.com/status-im/realm-js.git
synced 2025-01-23 21:10:01 +00:00
Make RJSStringForValue use consistent exception style
This commit is contained in:
parent
f5047af3bc
commit
213c3d832f
@ -47,10 +47,10 @@ std::string RJSStringForJSString(JSStringRef jsString) {
|
||||
}
|
||||
|
||||
std::string RJSStringForValue(JSContextRef ctx, JSValueRef value) {
|
||||
JSValueRef *exception;
|
||||
JSStringRef jsString = JSValueToStringCopy(ctx, value, exception);
|
||||
JSValueRef exception = NULL;
|
||||
JSStringRef jsString = JSValueToStringCopy(ctx, value, &exception);
|
||||
if (!jsString) {
|
||||
throw RJSException(ctx, *exception);
|
||||
throw RJSException(ctx, exception);
|
||||
}
|
||||
|
||||
std::string string = RJSStringForJSString(jsString);
|
||||
@ -97,4 +97,3 @@ bool RJSIsValueDate(JSContextRef ctx, JSValueRef value) {
|
||||
static JSStringRef dateString = JSStringCreateWithUTF8CString("Date");
|
||||
return RJSIsValueObjectOfType(ctx, value, dateString);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user