-
Notifications
You must be signed in to change notification settings - Fork 29.9k
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
Conversation
This enables the `no-unsafe-finally` eslint rule to make sure we have a proper control flow in try / catch.
test/common/index.js
Outdated
} finally { | ||
if (err || !output.includes('SeCreateSymbolicLinkPrivilege')) { | ||
const output = execSync(`${whoamiPath} /priv`, { timout: 1000 }); | ||
if (!output.includes('SeCreateSymbolicLinkPrivilege')) { | ||
return false; | ||
} |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yepp, absolutely
Landed in 4d3c3f0 |
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 <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: James M Snell <[email protected]>
There is another unsafe finally in v9.x, would you be willing to manually backport and fix it so we can review? |
Backported in #19244 that removed the other unsafe finally as well. |
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 <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: James M Snell <[email protected]>
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 <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: James M Snell <[email protected]>
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 <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: James M Snell <[email protected]>
Backport requested for 8.x in #19244 |
This enables the
no-unsafe-finally
eslint rule to make sure wehave a proper control flow in try / catch.
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
tools