Skip to content

fix: Improve error messages thrown by iOS runtime#1193

Merged
vtrifonov merged 5 commits intomasterfrom
bektchiev/improve-errors
Aug 27, 2019
Merged

fix: Improve error messages thrown by iOS runtime#1193
vtrifonov merged 5 commits intomasterfrom
bektchiev/improve-errors

Conversation

@mbektchiev
Copy link
Copy Markdown
Contributor

  • 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

  • fix(interop): Reset pointer after free

    • Reassign deleted pointers to nullptr
    • Don't reuse cached pointer instances which have been freed
  • refact: Don't throw in isValidType
    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.

  • fix(runtime): Improve error handling in overriding properties and methods

    • 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
  • chore: Add tests for error messages

PR Checklist

* 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
@mbektchiev mbektchiev added this to the 6.1.0 milestone Aug 26, 2019
@mbektchiev mbektchiev self-assigned this Aug 26, 2019
@cla-bot cla-bot Bot added the cla: yes label Aug 26, 2019
@vtrifonov vtrifonov merged commit d8071d2 into master Aug 27, 2019
@vtrifonov vtrifonov deleted the bektchiev/improve-errors branch August 27, 2019 08:27
mbektchiev added a commit to NativeScript/common-runtime-tests-app that referenced this pull request Oct 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants