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

buffer: use private properties for brand checks in File #47154

Merged
merged 1 commit into from
Mar 20, 2023

Conversation

KhafraDev
Copy link
Member

The current checks wouldn't work for certain values, and other places in the code have moved to this behavior as well.

import { File } from 'node:buffer'

const pd = Object.getOwnPropertyDescriptor(File.prototype, 'name')

pd.get.call(true) // Uncaught TypeError: Cannot use 'in' operator to search for '#name' in true

pd.get.call(null) // Uncaught TypeError [ERR_INVALID_THIS]: Value of "this" must be of type File

Refs: #46904

@nodejs-github-bot nodejs-github-bot added the needs-ci PRs that need a full CI run. label Mar 18, 2023
@anonrig anonrig added semver-major PRs that contain breaking changes and should be released in the next major version. author ready PRs that have at least one approval, no pending requests for changes, and a CI started. request-ci Add this label to start a Jenkins CI on a PR. labels Mar 18, 2023
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Mar 18, 2023
@nodejs-github-bot
Copy link
Collaborator

@anonrig
Copy link
Member

anonrig commented Mar 19, 2023

Since, this change is done on an experimental API, I'll remove my tag of semver-major. If this is wrongly removed, please add it.

@anonrig anonrig removed the semver-major PRs that contain breaking changes and should be released in the next major version. label Mar 19, 2023
@nodejs-github-bot
Copy link
Collaborator

@anonrig anonrig added the commit-queue Add this label to land a pull request using GitHub Actions. label Mar 20, 2023
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Mar 20, 2023
@nodejs-github-bot nodejs-github-bot merged commit 252a069 into nodejs:main Mar 20, 2023
@nodejs-github-bot
Copy link
Collaborator

Landed in 252a069

@KhafraDev KhafraDev deleted the file-brand-checks branch March 20, 2023 22:22
RafaelGSS pushed a commit that referenced this pull request Apr 5, 2023
PR-URL: #47154
Refs: #46904
Reviewed-By: Yagiz Nizipli <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
@RafaelGSS RafaelGSS mentioned this pull request Apr 6, 2023
RafaelGSS pushed a commit that referenced this pull request Apr 7, 2023
PR-URL: #47154
Refs: #46904
Reviewed-By: Yagiz Nizipli <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
danielleadams pushed a commit that referenced this pull request Jul 6, 2023
PR-URL: #47154
Refs: #46904
Reviewed-By: Yagiz Nizipli <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
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. needs-ci PRs that need a full CI run.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants