-
Notifications
You must be signed in to change notification settings - Fork 341
Handle non-reactive nulls (#231) #241
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
Conversation
700a858 to
a36b3cf
Compare
a36b3cf to
c8946b7
Compare
src/utils.ts
Outdated
| const hasOwnProperty = Object.prototype.hasOwnProperty; | ||
| export function hasOwn(obj: Object | any[], key: string): boolean { | ||
| return hasOwnProperty.call(obj, key); | ||
| return obj !== null && Object.hasOwnProperty.call(obj, key); |
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.
Better do the obj !== null test in the isReactive function.
And change the obj: Object to obj: object, to make the code clearer.
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.
@sodatea thanks for the feedback!
|
This is covered by #311 and no longer an issue in v0.6.1. However, I think we can take the unit-tests. |
Fix for #231 - Ensure non reactive nulls are supported.
Solution would be to check if the obj is null.