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
base: master
from

Conversation

@Trott
Copy link
Member

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
@Trott

This comment has been minimized.

Copy link
Member Author

Trott commented Mar 12, 2019

@Trott Trott added the author ready label Mar 12, 2019

@lpinca

lpinca approved these changes Mar 12, 2019

@BridgeAR

This comment has been minimized.

Copy link
Member

BridgeAR commented Mar 12, 2019

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

@mhdawson
Copy link
Member

mhdawson left a comment

LGTM

report: remove unnecessary return in setters
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 Trott force-pushed the Trott:useless-return branch from ff1c57c to cb48b85 Mar 12, 2019

@Trott

This comment has been minimized.

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

This comment has been minimized.

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

report: remove unnecessary return in setters
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 <riclau@uk.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Beth Griggs <Bethany.Griggs@uk.ibm.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: James M Snell <jasnell@gmail.com>

Drieger added a commit to Drieger/node that referenced this pull request Mar 22, 2019

report: remove unnecessary return in setters
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 <riclau@uk.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Beth Griggs <Bethany.Griggs@uk.ibm.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.