Skip to content
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

src: add receiver to fast api callback methods #54408

Merged
merged 4 commits into from
Sep 28, 2024

Conversation

Ceres6
Copy link
Contributor

@Ceres6 Ceres6 commented Aug 16, 2024

When creating an fast api the callback might use the receiver. In that case if the internal binding is destructured the method won't have access to the reciver and it will throw. Passing the receiver as second argument ensures the receiver is available.

When creating an fast api the callback might use the receiver. In that
case if the internal binding is destructured the method won't have
access to the reciver and it will throw. Passing the receiver as second
argument ensures the receiver is available.
@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/loaders
  • @nodejs/security-wg
  • @nodejs/tsc

@nodejs-github-bot nodejs-github-bot added lib / src Issues and PRs related to general changes in the lib or src directory. needs-ci PRs that need a full CI run. labels Aug 16, 2024
@Ceres6 Ceres6 marked this pull request as draft August 16, 2024 11:22
@Ceres6
Copy link
Contributor Author

Ceres6 commented Aug 16, 2024

cc @joyeecheung @anonrig

@ronag ronag requested a review from anonrig August 16, 2024 11:36
Copy link

codecov bot commented Aug 16, 2024

Codecov Report

Attention: Patch coverage is 50.00000% with 12 lines in your changes missing coverage. Please review.

Project coverage is 88.23%. Comparing base (2c14615) to head (41522d4).
Report is 822 commits behind head on main.

Files with missing lines Patch % Lines
src/histogram.cc 42.85% 4 Missing ⚠️
src/timers.cc 0.00% 4 Missing ⚠️
src/node_process.h 0.00% 2 Missing ⚠️
lib/internal/modules/esm/resolve.js 80.00% 0 Missing and 1 partial ⚠️
src/node_wasi.cc 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #54408      +/-   ##
==========================================
+ Coverage   87.08%   88.23%   +1.15%     
==========================================
  Files         648      651       +3     
  Lines      182341   183881    +1540     
  Branches    34982    35863     +881     
==========================================
+ Hits       158783   162252    +3469     
+ Misses      16831    14920    -1911     
+ Partials     6727     6709      -18     
Files with missing lines Coverage Δ
lib/fs.js 98.15% <100.00%> (+4.88%) ⬆️
lib/internal/fs/promises.js 98.24% <100.00%> (+0.68%) ⬆️
lib/internal/modules/cjs/loader.js 97.37% <100.00%> (+4.44%) ⬆️
src/histogram.h 60.00% <ø> (ø)
src/node_external_reference.h 100.00% <ø> (ø)
src/node_file.cc 76.99% <100.00%> (+0.10%) ⬆️
src/node_wasi.h 0.00% <ø> (ø)
src/timers.h 100.00% <ø> (ø)
lib/internal/modules/esm/resolve.js 96.54% <80.00%> (+0.09%) ⬆️
src/node_wasi.cc 65.36% <0.00%> (-1.79%) ⬇️
... and 3 more

... and 241 files with indirect coverage changes

Copy link
Member

@joyeecheung joyeecheung left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with doc nits

doc/contributing/adding-v8-fast-api.md Outdated Show resolved Hide resolved
doc/contributing/adding-v8-fast-api.md Show resolved Hide resolved
@Ceres6 Ceres6 marked this pull request as ready for review September 24, 2024 09:43
@anonrig anonrig added the request-ci Add this label to start a Jenkins CI on a PR. label Sep 24, 2024
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Sep 24, 2024
@nodejs-github-bot
Copy link
Collaborator

@Ceres6
Copy link
Contributor Author

Ceres6 commented Sep 25, 2024

The failing tests seem to be in the flaky list except pummel.test-hash-seed which might be a flake too. Should we re-run?

@tilemanrenovations

This comment was marked as off-topic.

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@aduh95 aduh95 added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. commit-queue Add this label to land a pull request using GitHub Actions. labels Sep 27, 2024
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Sep 27, 2024
@nodejs-github-bot nodejs-github-bot added the commit-queue-failed An error occurred while landing this pull request using GitHub Actions. label Sep 27, 2024
@nodejs-github-bot
Copy link
Collaborator

Commit Queue failed
- Loading data for nodejs/node/pull/54408
✔  Done loading data for nodejs/node/pull/54408
----------------------------------- PR info ------------------------------------
Title      src: add receiver to fast api callback methods (#54408)
   ⚠  Could not retrieve the email or name of the PR author's from user's GitHub profile!
Branch     Ceres6:feat/fast-api-recv -> nodejs:main
Labels     lib / src, author ready, needs-ci
Commits    4
 - src: add receiver to fast api callback methods
 - fixup! src: add receiver to fast api callback methods
 - Apply suggestions from code review
 - Update doc/contributing/adding-v8-fast-api.md
Committers 2
 - Carlos Espa <[email protected]>
 - GitHub <[email protected]>
PR-URL: https://github.com/nodejs/node/pull/54408
Reviewed-By: Stephen Belanger <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Yagiz Nizipli <[email protected]>
Reviewed-By: Santiago Gimeno <[email protected]>
------------------------------ Generated metadata ------------------------------
PR-URL: https://github.com/nodejs/node/pull/54408
Reviewed-By: Stephen Belanger <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Yagiz Nizipli <[email protected]>
Reviewed-By: Santiago Gimeno <[email protected]>
--------------------------------------------------------------------------------
   ℹ  This PR was created on Fri, 16 Aug 2024 11:17:33 GMT
   ✔  Approvals: 4
   ✔  - Stephen Belanger (@Qard): https://github.com/nodejs/node/pull/54408#pullrequestreview-2325953561
   ✔  - Joyee Cheung (@joyeecheung) (TSC): https://github.com/nodejs/node/pull/54408#pullrequestreview-2325962058
   ✔  - Yagiz Nizipli (@anonrig) (TSC): https://github.com/nodejs/node/pull/54408#pullrequestreview-2326113357
   ✔  - Santiago Gimeno (@santigimeno): https://github.com/nodejs/node/pull/54408#pullrequestreview-2326262397
   ✔  Last GitHub CI successful
   ℹ  Last Full PR CI on 2024-09-27T14:00:42Z: https://ci.nodejs.org/job/node-test-pull-request/62801/
- Querying data for job/node-test-pull-request/62801/
   ✔  Last Jenkins CI successful
--------------------------------------------------------------------------------
   ✔  No git cherry-pick in progress
   ✔  No git am in progress
   ✔  No git rebase in progress
--------------------------------------------------------------------------------
- Bringing origin/main up to date...
From https://github.com/nodejs/node
 * branch                  main       -> FETCH_HEAD
✔  origin/main is now up-to-date
- Downloading patch for 54408
From https://github.com/nodejs/node
 * branch                  refs/pull/54408/merge -> FETCH_HEAD
✔  Fetched commits as 1398c04c47a3..41522d482aff
--------------------------------------------------------------------------------
Auto-merging doc/api/cli.md
Auto-merging doc/api/permissions.md
Auto-merging doc/contributing/adding-v8-fast-api.md
Auto-merging lib/fs.js
Auto-merging lib/internal/fs/promises.js
Auto-merging lib/internal/modules/cjs/loader.js
Auto-merging lib/internal/modules/esm/resolve.js
Auto-merging src/node_external_reference.h
Auto-merging src/node_file.cc
[main c67d9876b8] src: add receiver to fast api callback methods
 Author: Carlos Espa <[email protected]>
 Date: Fri Aug 16 13:12:04 2024 +0200
 11 files changed, 33 insertions(+), 14 deletions(-)
Auto-merging src/histogram.cc
Auto-merging src/node_external_reference.h
Auto-merging src/node_wasi.cc
[main 465f1dd77f] fixup! src: add receiver to fast api callback methods
 Author: Carlos Espa <[email protected]>
 Date: Tue Sep 24 11:33:53 2024 +0200
 8 files changed, 86 insertions(+), 39 deletions(-)
Auto-merging doc/contributing/adding-v8-fast-api.md
[main 30e3a66a60] Apply suggestions from code review
 Author: Carlos Espa <[email protected]>
 Date: Tue Sep 24 11:38:03 2024 +0200
 1 file changed, 5 insertions(+), 1 deletion(-)
Auto-merging doc/contributing/adding-v8-fast-api.md
[main 92dad662f3] Update doc/contributing/adding-v8-fast-api.md
 Author: Carlos Espa <[email protected]>
 Date: Tue Sep 24 21:31:31 2024 +0200
 1 file changed, 1 insertion(+), 1 deletion(-)
   ✔  Patches applied
There are 4 commits in the PR. Attempting autorebase.
Rebasing (2/7)
Rebasing (3/7)

Executing: git node land --amend --yes
--------------------------------- New Message ----------------------------------
src: add receiver to fast api callback methods

When creating an fast api the callback might use the receiver. In that
case if the internal binding is destructured the method won't have
access to the reciver and it will throw. Passing the receiver as second
argument ensures the receiver is available.

PR-URL: #54408
Reviewed-By: Stephen Belanger <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Yagiz Nizipli <[email protected]>
Reviewed-By: Santiago Gimeno <[email protected]>

[detached HEAD 8be212e3bd] src: add receiver to fast api callback methods
Author: Carlos Espa <[email protected]>
Date: Fri Aug 16 13:12:04 2024 +0200
18 files changed, 119 insertions(+), 53 deletions(-)
Rebasing (4/7)
Rebasing (5/7)

Executing: git node land --amend --yes
--------------------------------- New Message ----------------------------------
Apply suggestions from code review

Co-authored-by: Joyee Cheung <[email protected]>
PR-URL: #54408
Reviewed-By: Stephen Belanger <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Yagiz Nizipli <[email protected]>
Reviewed-By: Santiago Gimeno <[email protected]>

[detached HEAD 05c8405575] Apply suggestions from code review
Author: Carlos Espa <[email protected]>
Date: Tue Sep 24 11:38:03 2024 +0200
1 file changed, 5 insertions(+), 1 deletion(-)
Rebasing (6/7)
Rebasing (7/7)

Executing: git node land --amend --yes
--------------------------------- New Message ----------------------------------
Update doc/contributing/adding-v8-fast-api.md

Co-authored-by: Aviv Keller <[email protected]>
PR-URL: #54408
Reviewed-By: Stephen Belanger <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Yagiz Nizipli <[email protected]>
Reviewed-By: Santiago Gimeno <[email protected]>

[detached HEAD 5456d37aed] Update doc/contributing/adding-v8-fast-api.md
Author: Carlos Espa <[email protected]>
Date: Tue Sep 24 21:31:31 2024 +0200
1 file changed, 1 insertion(+), 1 deletion(-)

Successfully rebased and updated refs/heads/main.

ℹ Add commit-queue-squash label to land the PR as one commit, or commit-queue-rebase to land as separate commits.

https://github.com/nodejs/node/actions/runs/11078730955

@mcollina mcollina added commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. commit-queue Add this label to land a pull request using GitHub Actions. labels Sep 28, 2024
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Sep 28, 2024
@nodejs-github-bot nodejs-github-bot merged commit f5d454a into nodejs:main Sep 28, 2024
69 checks passed
@nodejs-github-bot
Copy link
Collaborator

Landed in f5d454a

targos pushed a commit that referenced this pull request Oct 4, 2024
When creating an fast api the callback might use the receiver. In that
case if the internal binding is destructured the method won't have
access to the reciver and it will throw. Passing the receiver as second
argument ensures the receiver is available.

PR-URL: #54408
Reviewed-By: Stephen Belanger <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Yagiz Nizipli <[email protected]>
Reviewed-By: Santiago Gimeno <[email protected]>
targos pushed a commit that referenced this pull request Oct 4, 2024
When creating an fast api the callback might use the receiver. In that
case if the internal binding is destructured the method won't have
access to the reciver and it will throw. Passing the receiver as second
argument ensures the receiver is available.

PR-URL: #54408
Reviewed-By: Stephen Belanger <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Yagiz Nizipli <[email protected]>
Reviewed-By: Santiago Gimeno <[email protected]>
@aduh95 aduh95 mentioned this pull request Oct 9, 2024
louwers pushed a commit to louwers/node that referenced this pull request Nov 2, 2024
When creating an fast api the callback might use the receiver. In that
case if the internal binding is destructured the method won't have
access to the reciver and it will throw. Passing the receiver as second
argument ensures the receiver is available.

PR-URL: nodejs#54408
Reviewed-By: Stephen Belanger <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Yagiz Nizipli <[email protected]>
Reviewed-By: Santiago Gimeno <[email protected]>
@marco-ippolito marco-ippolito added the dont-land-on-v20.x PRs that should not land on the v20.x-staging branch and should not be released in v20.x. label Nov 16, 2024
codebytere added a commit to electron/electron that referenced this pull request Nov 20, 2024
tpoisseau pushed a commit to tpoisseau/node that referenced this pull request Nov 21, 2024
When creating an fast api the callback might use the receiver. In that
case if the internal binding is destructured the method won't have
access to the reciver and it will throw. Passing the receiver as second
argument ensures the receiver is available.

PR-URL: nodejs#54408
Reviewed-By: Stephen Belanger <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Yagiz Nizipli <[email protected]>
Reviewed-By: Santiago Gimeno <[email protected]>
codebytere added a commit to electron/electron that referenced this pull request Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. commit-queue-failed An error occurred while landing this pull request using GitHub Actions. commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. dont-land-on-v20.x PRs that should not land on the v20.x-staging branch and should not be released in v20.x. lib / src Issues and PRs related to general changes in the lib or src directory. needs-ci PRs that need a full CI run.
Projects
None yet
Development

Successfully merging this pull request may close these issues.