| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent d795865 commit 9d1e409
3 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -157,6 +157,7 @@ rules: | |||
| 157 | 157 | }] | |
| 158 | 158 | no-tabs: error | |
| 159 | 159 | no-trailing-spaces: error | |
| 160 | + no-unsafe-finally: error | ||
| 160 | 161 | object-curly-spacing: [error, always] | |
| 161 | 162 | one-var-declaration-per-line: error | |
| 162 | 163 | operator-linebreak: [error, after] | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -314,24 +314,24 @@ function tryOnTimeout(timer, list) { | |||
| 314 | 314 | } | |
| 315 | 315 | } | |
| 316 | 316 | ||
| 317 | - if (!threw) return; | ||
| 318 | - | ||
| 319 | - // Postpone all later list events to next tick. We need to do this | ||
| 320 | - // so that the events are called in the order they were created. | ||
| 321 | - const lists = list._unrefed === true ? unrefedLists : refedLists; | ||
| 322 | - for (var key in lists) { | ||
| 323 | - if (key > list.msecs) { | ||
| 324 | - lists[key].nextTick = true; | ||
| 317 | + if (threw) { | ||
| 318 | + // Postpone all later list events to next tick. We need to do this | ||
| 319 | + // so that the events are called in the order they were created. | ||
| 320 | + const lists = list._unrefed === true ? unrefedLists : refedLists; | ||
| 321 | + for (var key in lists) { | ||
| 322 | + if (key > list.msecs) { | ||
| 323 | + lists[key].nextTick = true; | ||
| 324 | + } | ||
| 325 | 325 | } | |
| 326 | + // We need to continue processing after domain error handling | ||
| 327 | + // is complete, but not by using whatever domain was left over | ||
| 328 | + // when the timeout threw its exception. | ||
| 329 | + const domain = process.domain; | ||
| 330 | + process.domain = null; | ||
| 331 | + // If we threw, we need to process the rest of the list in nextTick. | ||
| 332 | + process.nextTick(listOnTimeoutNT, list); | ||
| 333 | + process.domain = domain; | ||
| 326 | 334 | } | |
| 327 | - // We need to continue processing after domain error handling | ||
| 328 | - // is complete, but not by using whatever domain was left over | ||
| 329 | - // when the timeout threw its exception. | ||
| 330 | - const domain = process.domain; | ||
| 331 | - process.domain = null; | ||
| 332 | - // If we threw, we need to process the rest of the list in nextTick. | ||
| 333 | - process.nextTick(listOnTimeoutNT, list); | ||
| 334 | - process.domain = domain; | ||
| 335 | 335 | } | |
| 336 | 336 | } | |
| 337 | 337 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -514,21 +514,13 @@ exports.canCreateSymLink = function() { | |||
| 514 | 514 | const whoamiPath = path.join(process.env.SystemRoot, | |
| 515 | 515 | 'System32', 'whoami.exe'); | |
| 516 | 516 | ||
| 517 | - let err = false; | ||
| 518 | - let output = ''; | ||
| 519 | - | ||
| 520 | 517 | try { | |
| 521 | - output = execSync(`${whoamiPath} /priv`, { timout: 1000 }); | ||
| 518 | + const output = execSync(`${whoamiPath} /priv`, { timout: 1000 }); | ||
| 519 | + return output.includes('SeCreateSymbolicLinkPrivilege'); | ||
| 522 | 520 | } catch (e) { | |
| 523 | - err = true; | ||
| 524 | - } finally { | ||
| 525 | - if (err || !output.includes('SeCreateSymbolicLinkPrivilege')) { | ||
| 526 | - return false; | ||
| 527 | - } | ||
| 521 | + return false; | ||
| 528 | 522 | } | |
| 529 | 523 | } | |
| 530 | - | ||
| 531 | - return true; | ||
| 532 | 524 | }; | |
| 533 | 525 | ||
| 534 | 526 | exports.getCallSite = function getCallSite(top) { | |
| Back | FazBrowse Home | New Git URL |
0 commit comments