Skip to content
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 release] Fixes isEmpty for non-Ember.Map object with size property #14928

Closed
wants to merge 2 commits into from

Conversation

locks
Copy link
Contributor

@locks locks commented Feb 13, 2017

Fixes #14884
Relevant context: #9414

@@ -39,7 +40,7 @@ export default function isEmpty(obj) {

let objectType = typeof obj;

if (objectType === 'object') {
if (objectType instanceof EmberMap) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure if this matters, but this would not work if 2 embers where present on the same page. As there would be two different EmberMap and the isEmpty of one, could not work with the other.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fix for this, would be to add some property to EmberMap that we can check (e.g. obj.isEmberMap or obj[SOME_PRIVATE_EMBER_MAP_SYMBOL_THINGY] depending on how paranoid we want to be)...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for letting this slide. What's the call here? Will investigate CI failure.

Copy link
Sponsor Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lock I think the private, non-enumerable symbol would be the correct path.

@locks locks self-assigned this Jul 6, 2017
@locks
Copy link
Contributor Author

locks commented Jul 31, 2017

Close due to emberjs/rfcs#237.

@locks locks closed this Jul 31, 2017
@locks locks deleted the locks-patch-3 branch July 31, 2017 00:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants