summaryrefslogtreecommitdiff
path: root/test/common/index.js
diff options
context:
space:
mode:
authorRuben Bridgewater <ruben@bridgewater.de>2018-02-13 03:01:46 +0100
committerRuben Bridgewater <ruben@bridgewater.de>2018-02-16 16:42:43 +0100
commit4d3c3f039af08b954fbbba1e9a50979ffc98592b (patch)
tree608bdbca8df4f696dfb8bfe5de8b18cb6d87405c /test/common/index.js
parentd8d84eee18800f60e477e6ad6fb35c14f054f7f9 (diff)
downloadandroid-node-v8-4d3c3f039af08b954fbbba1e9a50979ffc98592b.tar.gz
android-node-v8-4d3c3f039af08b954fbbba1e9a50979ffc98592b.tar.bz2
android-node-v8-4d3c3f039af08b954fbbba1e9a50979ffc98592b.zip
tools: enable no-unsafe-finally
This enables the `no-unsafe-finally` eslint rule to make sure we have a proper control flow in try / catch. PR-URL: https://github.com/nodejs/node/pull/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>
Diffstat (limited to 'test/common/index.js')
-rw-r--r--test/common/index.js14
1 files changed, 3 insertions, 11 deletions
diff --git a/test/common/index.js b/test/common/index.js
index e8546db3a2..8ffeda42df 100644
--- a/test/common/index.js
+++ b/test/common/index.js
@@ -504,21 +504,13 @@ exports.canCreateSymLink = function() {
const whoamiPath = path.join(process.env['SystemRoot'],
'System32', 'whoami.exe');
- let err = false;
- let output = '';
-
try {
- output = execSync(`${whoamiPath} /priv`, { timout: 1000 });
+ const output = execSync(`${whoamiPath} /priv`, { timout: 1000 });
+ return output.includes('SeCreateSymbolicLinkPrivilege');
} catch (e) {
- err = true;
- } finally {
- if (err || !output.includes('SeCreateSymbolicLinkPrivilege')) {
- return false;
- }
+ return false;
}
}
-
- return true;
};
exports.getCallSite = function getCallSite(top) {