| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
Review requested:
|
Sorry, something went wrong.
|
Should we consider a bug fix as a breaking change? I don't think we should introduce a new workaround for bug fixes if the bug fix is not leading to fatal errors for legit use cases. |
Sorry, something went wrong.
In this PR we are introducing a new mechanism based on features that allows each module developer to choose the behavior they want:
Unlike the normal breaking changes that we had before which usually affect behavior of all addons and must be controlled by a node.js flag, this mechanism allows to:
I wonder if it would a better mechanism to adopt our changes in PR #36510 and #42208. |
Sorry, something went wrong.
|
I mean, why shouldn't we just fix the problem? This is not working as expected and fixing it won't introduce any fatal errors. I think fixing it will be a more straightforward option. |
Sorry, something went wrong.
I agree, but when we discussed this issue a few months ago, the agreement was that it is a behavioral change that may affect existing code. Thus, I thought it would be a good example to introduce the support of features. |
Sorry, something went wrong.
There was a problem hiding this comment.
Would enable and disable be better?
Sorry, something went wrong.
There was a problem hiding this comment.
Sounds good! I will rename them.
Sorry, something went wrong.
|
Per our discussion today in the Node-API meeting I am going to split up this PR into two parts: the bug fix and the implementation of features. |
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM, as although this can affect existing code, the behavior is wrong in a away that we don't believe any working code should be affected (based on discussion in recent Node-API team meeting)
Sorry, something went wrong.
There was a problem hiding this comment.
Nonblocking: I think we can split out the napi_key_enumerable to a new method to test we can actually get non-enumerable keys. Testing with an or-ed filter is an important use case too, so I think this is probably fine.
Sorry, something went wrong.
There was a problem hiding this comment.
@legendecas, it is a good point! I did it originally that way, but the issue was that it returns too many properties such as all method names from Object. So, adding the napi_key_enumerable was the simplest way to work around it. Though, I can probably do it for the current object only without including prototypes.
Sorry, something went wrong.
Is that something you'd like to do before we land this or possibly as as follow on. I see @legendecas's comment is not blocking but don't want to land if you want to update before we do that. |
Sorry, something went wrong.
@mhdawson, I have added tests for own non-enumerable properties to test writable and configurable flags in isolation. |
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM
Sorry, something went wrong.
Sorry, something went wrong.
Commit Queue failed- Loading data for nodejs/node/pull/42463 ✔ Done loading data for nodejs/node/pull/42463 ----------------------------------- PR info ------------------------------------ Title node-api: fix napi_get_all_property_names use of napi_key_configurable filter (#42463) ⚠ Could not retrieve the email or name of the PR author's from user's GitHub profile! Branch vmoroz:PR/FixGetAllPropertyNames -> nodejs:master Labels c++, lib / src, node-api, needs-ci, commit-queue-squash Commits 4 - node-api: fix napi_get_all_property_names - remove support for features - Merge branch 'master' into PR/FixGetAllPropertyNames - add tests for non-enumerable properties Committers 1 - Vladimir Morozov PR-URL: https://github.com/nodejs/node/pull/42463 Reviewed-By: Michael Dawson Reviewed-By: Chengzhong Wu Reviewed-By: James M Snell ------------------------------ Generated metadata ------------------------------ PR-URL: https://github.com/nodejs/node/pull/42463 Reviewed-By: Michael Dawson Reviewed-By: Chengzhong Wu Reviewed-By: James M Snell -------------------------------------------------------------------------------- ℹ This PR was created on Fri, 25 Mar 2022 06:12:10 GMT ✔ Approvals: 3 ✔ - Michael Dawson (@mhdawson) (TSC): https://github.com/nodejs/node/pull/42463#pullrequestreview-939948462 ✔ - Chengzhong Wu (@legendecas): https://github.com/nodejs/node/pull/42463#pullrequestreview-928378619 ✔ - James M Snell (@jasnell) (TSC): https://github.com/nodejs/node/pull/42463#pullrequestreview-941150971 ✔ Last GitHub CI successful ℹ Last Full PR CI on 2022-04-12T18:03:32Z: https://ci.nodejs.org/job/node-test-pull-request/43463/ - Querying data for job/node-test-pull-request/43463/ ✔ Last Jenkins CI successful -------------------------------------------------------------------------------- ✔ No git cherry-pick in progress ✔ No git am in progress ✔ No git rebase in progress -------------------------------------------------------------------------------- - Bringing origin/master up to date... From https://github.com/nodejs/node * branch master -> FETCH_HEAD ✔ origin/master is now up-to-date - Downloading patch for 42463 From https://github.com/nodejs/node * branch refs/pull/42463/merge -> FETCH_HEAD ✔ Fetched commits as 3026ca0bf2d6..1d071f0f1c58 -------------------------------------------------------------------------------- Auto-merging src/node_api.h [master 822ca46330] node-api: fix napi_get_all_property_names Author: Vladimir Morozov Date: Thu Mar 24 22:55:39 2022 -0700 10 files changed, 245 insertions(+), 12 deletions(-) Auto-merging src/node_api.h error: commit da279a1982b27fd85605f7d8a698c94934df1ce0 is a merge but no -m option was given. fatal: cherry-pick failed [master 90936a3715] remove support for features Author: Vladimir Morozov Date: Wed Mar 30 07:39:52 2022 -0700 10 files changed, 11 insertions(+), 156 deletions(-) ✖ Failed to apply patcheshttps://github.com/nodejs/node/actions/runs/2163283381 |
Sorry, something went wrong.
|
@vmoroz could you rebase and squash the commits? I tried manually and with the commit queue and it won't easily squash. |
Sorry, something went wrong.
Let me try. |
Sorry, something went wrong.
Sorry, something went wrong.
Sorry, something went wrong.
Sorry, something went wrong.
Sorry, something went wrong.
PR-URL: #42463 Reviewed-By: Michael Dawson <midawson@redhat.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
|
@vmoroz thanks for all your work/patience in getting this landed. |
Sorry, something went wrong.
PR-URL: #42463 Reviewed-By: Michael Dawson <midawson@redhat.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: #42463 Reviewed-By: Michael Dawson <midawson@redhat.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: #42463 Reviewed-By: Michael Dawson <midawson@redhat.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: #42463 Reviewed-By: Michael Dawson <midawson@redhat.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: #42463 Reviewed-By: Michael Dawson <midawson@redhat.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: nodejs/node#42463 Reviewed-By: Michael Dawson <midawson@redhat.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
| Back | FazBrowse Home | New Git URL |
What is the issue?
Currently napi_get_all_property_names has a bug where the napi_key_configurable filter is used as napi_key_writable filter. As a result, it is not possible to filter property names by napi_key_configurable.
Since it is a rare scenario, the issue was not observed, and there were no tests for it.
The fix description
The code is fixed to use v8::PropertyFilter::ONLY_CONFIGURABLE for the napi_key_configurable filter instead of v8::PropertyFilter::ONLY_WRITABLE.
New test cases were added to check this scenario.