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

report: remove unnecessary return in setters #26614

Closed
wants to merge 1 commit into from

Conversation

Trott
Copy link
Member

@Trott Trott commented Mar 12, 2019

Barring shenanigans such as using Object.getOwnPropertyDescriptor(), return values from a setter function will always be inaccessible. Remove
the return statements as they can be misleading, suggesting that the
return value is accessible and perhaps used somewhere.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines

@nodejs-github-bot nodejs-github-bot added the process Issues and PRs related to the process subsystem. label Mar 12, 2019
@Trott Trott added the report Issues and PRs related to process.report. label Mar 12, 2019
@Trott
Copy link
Member Author

Trott commented Mar 12, 2019

@Trott Trott added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Mar 12, 2019
@BridgeAR
Copy link
Member

The value is accessible when using Object.getOwnPropertyDescriptor but that should not be a "valid" use case.

Copy link
Member

@mhdawson mhdawson left a comment

Choose a reason for hiding this comment

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

LGTM

Barring shenanigans like Object.getOwnPropertyDescriptor(), return
values from a setter function will always be inaccessible. Remove
the `return` statements as they can be misleading, suggesting that the
return value is accessible and perhaps used somewhere.
@Trott
Copy link
Member Author

Trott commented Mar 12, 2019

The value is accessible when using Object.getOwnPropertyDescriptor but that should not be a "valid" use case.

Updated the commit message to acknowledge this potential for shenanigans. Rebased so re-running CI out of abundance of caution: https://ci.nodejs.org/job/node-test-pull-request/21479/

@Trott
Copy link
Member Author

Trott commented Mar 14, 2019

Landed in d78d33d

@Trott Trott closed this Mar 14, 2019
Trott added a commit to Trott/io.js that referenced this pull request Mar 14, 2019
Barring shenanigans like Object.getOwnPropertyDescriptor(), return
values from a setter function will always be inaccessible. Remove
the `return` statements as they can be misleading, suggesting that the
return value is accessible and perhaps used somewhere.

PR-URL: nodejs#26614
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Beth Griggs <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
targos pushed a commit to targos/node that referenced this pull request Mar 27, 2019
Barring shenanigans like Object.getOwnPropertyDescriptor(), return
values from a setter function will always be inaccessible. Remove
the `return` statements as they can be misleading, suggesting that the
return value is accessible and perhaps used somewhere.

PR-URL: nodejs#26614
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Beth Griggs <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
targos pushed a commit that referenced this pull request Mar 27, 2019
Barring shenanigans like Object.getOwnPropertyDescriptor(), return
values from a setter function will always be inaccessible. Remove
the `return` statements as they can be misleading, suggesting that the
return value is accessible and perhaps used somewhere.

PR-URL: #26614
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Beth Griggs <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
@Trott Trott deleted the useless-return branch January 13, 2022 22:51
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. process Issues and PRs related to the process subsystem. report Issues and PRs related to process.report.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants