fix: Improve error messages thrown by iOS runtime#1193
Merged
Conversation
* Use `defaultSourceAppender` for more detailed failed expression identification in thrown errors * Change `Function required` error to match the actual validation check: `Exactly 1 argument which must be a function required`
* Reassign deleted pointers to `nullptr` * Don't reuse cached pointer instances which have been freed
Make it a simple check whether its a valid type encoding or not and leave exception throwing to caller. It can construct a more meaningful error message because it has more context.
…hods * Add `deepInstanceProperty` and `deepInstanceMethod` getters in `BaseClassMeta` * Refactor `_protocols` field to use `ProtocolMetas` * Check and throw errors when overriding a native method with a JS property or a native property with a JS function
vtrifonov
approved these changes
Aug 27, 2019
mbektchiev
added a commit
to NativeScript/common-runtime-tests-app
that referenced
this pull request
Oct 15, 2019
Forgotten to be committed along with NativeScript/ios-jsc#1193
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Use
defaultSourceAppenderfor more detailed failedexpression identification in thrown errors
Change
Function requirederror to match the actual validationcheck:
Exactly 1 argument which must be a function requiredfix(interop): Reset pointer after free
nullptrrefact: Don't throw in
isValidTypeMake it a simple check whether its a valid type encoding or not
and leave exception throwing to caller. It can construct a
more meaningful error message because it has more context.
fix(runtime): Improve error handling in overriding properties and methods
deepInstancePropertyanddeepInstanceMethodgetters inBaseClassMeta_protocolsfield to useProtocolMetasa JS property or a native property with a JS function
chore: Add tests for error messages
PR Checklist