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] Fix finishChains #5575

Merged
merged 1 commit into from
Sep 22, 2014

Conversation

krisselden
Copy link
Contributor

Fix finishChains for all chains that reference an obj not just the ones rooted at that object.

// finish any current chains node watchers that reference obj
chainWatchers = m.chainWatchers;
if (chainWatchers) {
for(var key in chainWatchers) {
Copy link
Member

Choose a reason for hiding this comment

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

Object.keys or custom chainsNodesFrom instead of hasOwnProperty check should prevent potential deopt of key in chainWatchers

Copy link
Member

Choose a reason for hiding this comment

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

Slight pedantic note: if we need Object.keys behavior we should use Ember.keys instead (it is basically Object.keys when that exists but still works in ES3 browsers).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As far as I know, this isn't the slow case (chainWatchers are always simple objects and copied), and I'm hesitant to make this change as part of this pull, since none of the other code in chains.js is using keys over for/in, I'd rather see the switch to keys() uniformly in chains with some cross browser perf data.

krisselden added a commit that referenced this pull request Sep 22, 2014
@krisselden krisselden merged commit 755057a into emberjs:master Sep 22, 2014
@krisselden krisselden deleted the fix-finish-chains branch September 22, 2014 06:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants