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

tools: enable no-unsafe-finally #18745

Closed
wants to merge 2 commits into from

Conversation

BridgeAR
Copy link
Member

This enables the no-unsafe-finally eslint rule to make sure we
have a proper control flow in try / catch.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines
Affected core subsystem(s)

tools

This enables the `no-unsafe-finally` eslint rule to make sure we
have a proper control flow in try / catch.
@nodejs-github-bot nodejs-github-bot added the tools Issues and PRs related to the tools directory. label Feb 13, 2018
} finally {
if (err || !output.includes('SeCreateSymbolicLinkPrivilege')) {
const output = execSync(`${whoamiPath} /priv`, { timout: 1000 });
if (!output.includes('SeCreateSymbolicLinkPrivilege')) {
return false;
}
Copy link
Member

Choose a reason for hiding this comment

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

Can be simplified to just this, I think?

return output.includes('SeCreateSymbolicLinkPrivilege');

And then you don't need the return true a few lines below.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yepp, absolutely

@BridgeAR
Copy link
Member Author

@BridgeAR BridgeAR added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Feb 13, 2018
@BridgeAR BridgeAR added the fast-track PRs that do not need to wait for 48 hours to land. label Feb 13, 2018
@BridgeAR
Copy link
Member Author

Landed in 4d3c3f0

@BridgeAR BridgeAR closed this Feb 16, 2018
BridgeAR added a commit to BridgeAR/node that referenced this pull request Feb 16, 2018
This enables the `no-unsafe-finally` eslint rule to make sure we
have a proper control flow in try / catch.

PR-URL: nodejs#18745
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@MylesBorins
Copy link
Contributor

There is another unsafe finally in v9.x, would you be willing to manually backport and fix it so we can review?

@BridgeAR
Copy link
Member Author

Backported in #19244 that removed the other unsafe finally as well.

BridgeAR added a commit to BridgeAR/node that referenced this pull request Mar 21, 2018
This enables the `no-unsafe-finally` eslint rule to make sure we
have a proper control flow in try / catch.

PR-URL: nodejs#18745
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
MylesBorins pushed a commit that referenced this pull request Mar 21, 2018
This enables the `no-unsafe-finally` eslint rule to make sure we
have a proper control flow in try / catch.

Backport-PR-URL: #19244
PR-URL: #18745
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@targos targos mentioned this pull request Mar 21, 2018
MayaLekova pushed a commit to MayaLekova/node that referenced this pull request May 8, 2018
This enables the `no-unsafe-finally` eslint rule to make sure we
have a proper control flow in try / catch.

PR-URL: nodejs#18745
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@MylesBorins
Copy link
Contributor

Backport requested for 8.x in #19244

@BridgeAR BridgeAR deleted the no-unsafe-finally branch April 1, 2019 23:38
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. fast-track PRs that do not need to wait for 48 hours to land. tools Issues and PRs related to the tools directory.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants