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

mapBy('parent') yields the Window object for nulls #4798

Closed
macu opened this issue May 1, 2014 · 1 comment
Closed

mapBy('parent') yields the Window object for nulls #4798

macu opened this issue May 1, 2014 · 1 comment

Comments

@macu
Copy link

macu commented May 1, 2014

I have a function that recurses up a tree from a source array of leaf nodes, collecting parents along the way via nodes.mapBy('parent'). Normally, node.get('parent') yields undefined, but suppose it ever yields null. On the next pass over the array, to get the parents of the parents, my function fell into an infinite loop which led me to discover that mapBy yields the Window object for nulls, and window.parent refers back to window. Nice!

http://jsbin.com/fehayaza/43/

@rwjblue
Copy link
Member

rwjblue commented May 1, 2014

Ember.get(null, 'parent') //=> Window

See #3852 for more details (and the fix).

@rwjblue rwjblue closed this as completed May 1, 2014
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

No branches or pull requests

2 participants