This repository has been archived by the owner on Feb 22, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 248
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(dirty-checking): handle simultaneous mutations and ref changes
This applies to both maps and lists/iterables. Consider the case when one is watching an expression, say, `items`, that evaluates a list. Now consider the case when one both mutates that list and also updates `items` to point to a different list. In this case, the reported changes should be between the earlier observed collection and the newly observed collection. The previous implementation is buggy. It first observes that the original list was mutated and then observes that the reference to the list was updated to a different list. The changes it reports are the differences between the mutated list and the new list which is incorrect. This commit fixes the bug by noticing the case when both a mutation of the previously tracked sequence and a ref change occurs and resets the change record to undo the recording of the mutation.
- Loading branch information
Showing
4 changed files
with
444 additions
and
191 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.