-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(ios): manually evaluate all error properties #11576
Changes from 2 commits
01f9307
c9982fa
581f7e8
c9fd4a2
af8c151
de7e9d5
8c3752f
3b9039e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -314,9 +314,8 @@ - (void)evalFileOnThread:(NSString *)path context:(KrollContext *)context_ | |
} | ||
} | ||
if (exception != NULL) { | ||
id excm = [KrollObject toID:context value:exception]; | ||
evaluationError = YES; | ||
[[TiExceptionHandler defaultExceptionHandler] reportScriptError:[TiUtils scriptErrorValue:excm]]; | ||
[TiExceptionHandler.defaultExceptionHandler reportScriptError:exception inKrollContext:context]; | ||
} | ||
|
||
JSStringRelease(jsCode); | ||
|
@@ -692,8 +691,7 @@ - (KrollWrapper *)loadCommonJSModule:(NSString *)code withSourceURL:(NSURL *)sou | |
[eval release]; | ||
|
||
if (exception != NULL) { | ||
id excm = [KrollObject toID:context value:exception]; | ||
[[TiExceptionHandler defaultExceptionHandler] reportScriptError:[TiUtils scriptErrorValue:excm]]; | ||
[TiExceptionHandler.defaultExceptionHandler reportScriptError:exception inKrollContext:context]; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @janvennemann I think two methods you introduced in TiExceptionHandler are not required. You can get TiScriptError by using the new method in TiUtils. Something like below - [TiExceptionHandler.defaultExceptionHandler reportScriptError:[TiUtils scriptErrorFromValueRef: exception inContext: context.context]]; There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sure, they are not required. However, i added them purely for convenience reasons since we have different source types that we need to create IMHO |
||
return nil; | ||
} | ||
/* | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@janvennemann defaultExceptionHandler is a method not property. I think it should be used as [TiExceptionHandler defaultExceptionHandler]. Same applies for other places.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Technically, a property will only create a variable and getter/setters for you and the compiler will automatically call the getter method when you access the property. By using
TiExceptionHandler.defaultExceptionHandler
here I just instruct the compiler to automatically call the methoddefaultExceptionHandler
, so it shouldn't make a difference.