-
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.
Restrict ObjectCanon prototypes to {Array,Object}.prototype and null.
As promised in #8222 (comment), a more general implementation of ObjectCanon is coming, so I think we should restrict the functionality of the current implementation to match what we have planned. First, I want to reserve the isCanonical method to return true for anything that doesn't need to be (further) canonized, including primitive values. To that end, the isKnown method now returns true only for *objects* previously returned by canon.admit. Second, the future implemenation will allow full customization of canonization by object prototype, but will only canonize arrays and plain objects by default. To that end, I've resricted ObjectCanon canonization to objects whose prototypes are Array.prototype, Object.prototype, or null.
- Loading branch information
Showing
5 changed files
with
16 additions
and
14 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
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
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