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

Fix issue with unchaining ChainNodes (again) #15982

Merged
merged 2 commits into from
Dec 14, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions packages/ember-metal/lib/chains.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,11 +209,8 @@ class ChainNode {
remove(path) {
let paths = this._paths;
if (paths === undefined) { return; }

if (paths[path] > 0) {
paths[path]--;
} else {
return;
Copy link
Contributor

Choose a reason for hiding this comment

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

why not to add assert here to know that there was unbalanced unchain or is it too much ? @krisselden

}

let key = firstKey(path);
Expand Down
2 changes: 1 addition & 1 deletion packages/ember-metal/lib/watch_path.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export function unwatchPath(obj, keyPath, meta) {

if (counter === 1) {
m.writeWatching(keyPath, 0);
m.readableChains().remove(keyPath);
m.writableChains(makeChainNode).remove(keyPath);
} else if (counter > 1) {
m.writeWatching(keyPath, counter - 1);
}
Expand Down