-
-
Notifications
You must be signed in to change notification settings - Fork 4.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
[BUGFIX] isEmpty on nested objects #16879
Conversation
packages/ember-metal/lib/is_empty.ts
Outdated
let length = get(obj, 'length'); | ||
if (typeof length === 'number') { | ||
return !length; | ||
} | ||
} | ||
|
||
if (typeof obj.length === 'number' && objectType !== 'function') { |
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.
Hmm, do we even need this check anymore?
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.
This is what allows an empty string (''
) to be marked as empty.
This comment has been minimized.
This comment has been minimized.
@janvotava do you have some time to pick this back up? 😅 |
So ArrayProxy inside ObjectProxy works with ES5 getters Fixes emberjs#16878
053db77
to
4d02c25
Compare
@janvotava @locks I rebased this for you. |
@locks I'm sorry. What exactly do you mean by that? 😅 |
All is good, @wagenet took care of it :) |
So ArrayProxy inside ObjectProxy works with ES5 getters and there's no
Assertion Failed: You attempted to access the 'length' property
error.Fixes #16878