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

vm,src: add property query interceptors #53517

Closed
wants to merge 3 commits into from

Conversation

legendecas
Copy link
Member

@legendecas legendecas commented Jun 20, 2024

src: remove unused ContextifyContext::WeakCallback

ContextifyContext::WeakCallback is unused.

vm,src: add property query interceptors

Distinguish named property and indexed property when enumerating keys
and handle query interceptions.

Co-Authored-By: Michaël Zasso targos@protonmail.com
Fixes: #52720

Re-landing #53172

/cc @nodejs/vm

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. needs-ci PRs that need a full CI run. vm Issues and PRs related to the vm subsystem. labels Jun 20, 2024
@legendecas legendecas added the commit-queue-rebase Add this label to allow the Commit Queue to land a PR in several commits. label Jun 20, 2024
Distinguish named property and indexed property when enumerating keys
and handle query interceptions.

Co-Authored-By: Michaël Zasso <targos@protonmail.com>
@legendecas legendecas added dont-land-on-v18.x PRs that should not land on the v18.x-staging branch and should not be released in v18.x. dont-land-on-v20.x PRs that should not land on the v20.x-staging branch and should not be released in v20.x. dont-land-on-v22.x PRs that should not land on the v22.x-staging branch and should not be released in v22.x. request-ci Add this label to start a Jenkins CI on a PR. and removed dont-land-on-v22.x PRs that should not land on the v22.x-staging branch and should not be released in v22.x. dont-land-on-v18.x PRs that should not land on the v18.x-staging branch and should not be released in v18.x. dont-land-on-v20.x PRs that should not land on the v20.x-staging branch and should not be released in v20.x. labels Jun 20, 2024
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jun 21, 2024

Local<Array> properties;

if (!ctx->sandbox()->GetPropertyNames(context).ToLocal(&properties)) return;
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't we just use the variant of GetPropertyNames with a property filter that skips strings and symbols + KeyConversionMode::kKeepNumbers?

Copy link
Member Author

Choose a reason for hiding this comment

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

PropertyFilter::SKIP_STRINGS would filter both strings including indices. It is the counter argument to PropertyFilter::SKIP_SYMBOLS.

Copy link
Member

Choose a reason for hiding this comment

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

Oh I see, maybe just PropertyFilter::SKIP_SYMBOLS and KeyConversionMode::kKeepNumbers?

Copy link
Member Author

Choose a reason for hiding this comment

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

Removed unnecessary type conversion in dd8c0c6.

@legendecas legendecas added the request-ci Add this label to start a Jenkins CI on a PR. label Jul 5, 2024
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jul 5, 2024
@legendecas
Copy link
Member Author

@joyeecheung would you mind taking a look again? thanks!

@legendecas legendecas added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Jul 9, 2024
@legendecas legendecas added the commit-queue Add this label to land a pull request using GitHub Actions. label Jul 9, 2024
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Jul 9, 2024
@nodejs-github-bot
Copy link
Collaborator

Landed in 2b068ff...c0962dc

nodejs-github-bot pushed a commit that referenced this pull request Jul 9, 2024
PR-URL: #53517
Fixes: #52720
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
nodejs-github-bot pushed a commit that referenced this pull request Jul 9, 2024
Distinguish named property and indexed property when enumerating keys
and handle query interceptions.

Co-Authored-By: Michaël Zasso <targos@protonmail.com>
PR-URL: #53517
Fixes: #52720
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
@legendecas legendecas deleted the vm/interceptor branch July 9, 2024 09:47
aduh95 pushed a commit that referenced this pull request Jul 12, 2024
PR-URL: #53517
Fixes: #52720
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
aduh95 pushed a commit that referenced this pull request Jul 12, 2024
Distinguish named property and indexed property when enumerating keys
and handle query interceptions.

Co-Authored-By: Michaël Zasso <targos@protonmail.com>
PR-URL: #53517
Fixes: #52720
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
@aduh95 aduh95 mentioned this pull request Jul 12, 2024
aduh95 pushed a commit that referenced this pull request Jul 16, 2024
PR-URL: #53517
Fixes: #52720
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
aduh95 pushed a commit that referenced this pull request Jul 16, 2024
Distinguish named property and indexed property when enumerating keys
and handle query interceptions.

Co-Authored-By: Michaël Zasso <targos@protonmail.com>
PR-URL: #53517
Fixes: #52720
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
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. c++ Issues and PRs that require attention from people who are familiar with C++. commit-queue-rebase Add this label to allow the Commit Queue to land a PR in several commits. needs-ci PRs that need a full CI run. vm Issues and PRs related to the vm subsystem.
4 participants