-
Notifications
You must be signed in to change notification settings - Fork 504
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: remove AllCan Read/Write #963
base: main
Are you sure you want to change the base?
Conversation
Thank you. I am concerned about the signature changes. It seems like it should be possible to paper over the differences without breaking the NAN API. Assuming that v8::AccessControl is just a straight enum, it should be replaceable by an int. SetAccessor could be deprecated (again...) and a new one introduced without the settings parameter, shoving default for old versions. Now, due to the bad choice of using default arguments, C++ overload resolution becomes a mess I no longer remember. Might need to make a bunch of overloads for varying number of arguments instead, which is how it should have been written in the first place, since default arguments are bad design and should not be used, but I digress.
…On November 14, 2023 11:13:41 PM GMT+02:00, Samuel Attard ***@***.***> wrote:
Refs https://chromium-review.googlesource.com/c/v8/v8/+/5006387
Fixes native module compilation against node 21 / incoming v8 changes
You can view, comment on, or merge this pull request online at:
#963
-- Commit Summary --
* fix: remove AllCan Read/Write
-- File Changes --
M nan.h (19)
-- Patch Links --
https://github.com/nodejs/nan/pull/963.patch
https://github.com/nodejs/nan/pull/963.diff
|
@kkoopa I could move |
Yes, that might work. All I want is to avoid breaking NANs API directly while retaining the same observable behavior across versions.
I remember dealing with something similar in one of these default parameter functions previously. I ended up adding n overloads of increasing arity, where n was the number of default parameters, which happens to be the correct way of doing it in the first place. Default parameters in C++ are garbage.
…On November 20, 2023 9:26:22 PM GMT+02:00, Samuel Attard ***@***.***> wrote:
@kkoopa I could move `settings` after `attribute` and default it correctly in all cases, that should avoid the signature being meaningfully different 🤔 Although annoying because it wouldn't match the argument order to v8 but not the end of the world if the nan helper is deprecated anyway
|
Turns out the actual enum hasn't been removed, so the nan signature can be the same we just need to safely ifdef the impl. Should be safe now |
Wonderful. That makes it a lot easier. Now, I would still like to have |
Refs https://chromium-review.googlesource.com/c/v8/v8/+/5006387
Fixes native module compilation against node 21 / incoming v8 changes