-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Completely remove unnecessary ID_KEY Symbol.
Restoring non-enumerability of the ID_KEY Symbol in #3544 made ID_KEY slightly more hidden from application code, at the cost of slightly worse performance (because of Object.defineProperty), but tests were still broken because Jest now includes Symbol keys when checking object equality (even the non-enumerable ones). Fortunately, given all the previousResult refactoring that has happened in PR #3394, we no longer need to store ID_KEY properties at all, which completely side-steps the question of whether ID_KEY should be enumerable or not, and avoids any problems due to Jest including Symbol keys when checking deep equality. If we decide to bring this ID metadata back in the future, we could use a WeakMap to associate result objects with their IDs, so that we can avoid modifying the result objects.
- Loading branch information
Showing
2 changed files
with
31 additions
and
48 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