This repository was archived by the owner on Mar 25, 2023. It is now read-only.
Closed
Conversation
Generate idempotent versions of property getter results for attributes marked as `SameObject`.
8ee41e6 to
5c2df85
Compare
kainino0x
approved these changes
Nov 13, 2020
| napi_status Wrapping<T>::Retrieve(napi_env env, | ||
| napi_value js_rcv, | ||
| T** cc_rcv, | ||
| int ref_idx, |
There was a problem hiding this comment.
optional suggestion: I think I eventually figured out how it worked, but this system is pretty hard to follow. Seems like you assign a ref_idx to each member that has [SameObject], and then store the ref for that value in refs[ref_idx] for that member. Could it be possible to have the refs members instead be actual named napi_ref members in a generated struct?
Current code looks reasonably correct though.
Contributor
Author
There was a problem hiding this comment.
I could go with a std::map instead.
There was a problem hiding this comment.
If the map would be keyed on a string, I think the current code is better.
gabrielschulhof
pushed a commit
that referenced
this pull request
Nov 16, 2020
Generate idempotent versions of property getter results for attributes marked as `SameObject`. Signed-off-by: Gabriel Schulhof <gabriel.schulhof@intel.com> PR-URL: #19 Reviewed-By: Kai Ninomiya <kainino@chromium.org>
Contributor
Author
|
Landed in 88a9f9a. |
This file contains hidden or 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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Generate idempotent versions of property getter results for attributes
marked as
SameObject.