Skip to content

Commit

Permalink
fix(ios)(8_0_X): Instead of native exception send javascript exception (
Browse files Browse the repository at this point in the history
#10883)

* fix(iOS): Instead of native exception send javascript exception

* fix(ios): removed unnecessary code

* fix(iOS): Instead of native stack use js stack

* fix(iOS) : Instead of native error stack send js error stack

* fix(iOS): Instead of native exception send javascript exception
  • Loading branch information
vijaysingh-axway authored and keerthi1032 committed May 31, 2019
1 parent 6af143c commit 71f89e9
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions iphone/TitaniumKit/TitaniumKit/Sources/Kroll/KrollContext.m
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,11 @@ - (void)invoke:(KrollContext *)context

JSValueRef ThrowException(JSContextRef ctx, NSString *message, JSValueRef *exception)
{
JSStringRef jsString = JSStringCreateWithCFString((CFStringRef)message);
*exception = JSValueMakeString(ctx, jsString);
JSStringRelease(jsString);
JSGlobalContextRef globalContextRef = JSContextGetGlobalContext(ctx);
JSContext *context = [JSContext contextWithJSGlobalContextRef:globalContextRef];
JSValue *value = [JSValue valueWithNewErrorFromMessage:message inContext:context];
*exception = value.JSValueRef;

return JSValueMakeUndefined(ctx);
}

Expand Down

0 comments on commit 71f89e9

Please sign in to comment.