forked from facebook/hermes
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Clarify const-ness of JSI references
Summary: Many operations on references in JS can modify the referent by executing additional JS, including operations that we currently mark as const such as `getProperty`. Because of this, the current distinction between const and non-const operations on references like `jsi::Object` is somewhat arbitrary. A more consistent approach is to mark all operations as const, so that it is clear that the const-ness applies to the reference and not the referent. This is analogous to how smart pointers work, since something like `const shared_ptr<T>` only makes the pointer const, as opposed to `shared_ptr<const T>`. This also gives users better guarantees and more flexibility in where these references may be used. Changelog: [General][Changed] - Mark methods on JSI references as const. Reviewed By: fbmal7 Differential Revision: D41599116 fbshipit-source-id: 40b1537581b09c5a34d0928ee04e7db2b50d26ea
- Loading branch information
1 parent
2c35622
commit b816665
Showing
6 changed files
with
72 additions
and
53 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
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