GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — tools: enable no-unsafe-finally · nodejs/node@9d1e409

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • .eslintrc.yaml
  • lib
    • timers.js
  • test/common
    • index.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎.eslintrc.yaml‎

Copy file name to clipboardExpand all lines: .eslintrc.yaml
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ rules:
157157
}]
158158
no-tabs: error
159159
no-trailing-spaces: error
160+
no-unsafe-finally: error
160161
object-curly-spacing: [error, always]
161162
one-var-declaration-per-line: error
162163
operator-linebreak: [error, after]
Collapse file

‎lib/timers.js‎

Copy file name to clipboardExpand all lines: lib/timers.js
+16-16Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -314,24 +314,24 @@ function tryOnTimeout(timer, list) {
314314
}
315315
}
316316

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+
}
325325
}
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;
326334
}
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;
335335
}
336336
}
337337

Collapse file

‎test/common/index.js‎

Copy file name to clipboardExpand all lines: test/common/index.js
+3-11Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -514,21 +514,13 @@ exports.canCreateSymLink = function() {
514514
const whoamiPath = path.join(process.env.SystemRoot,
515515
'System32', 'whoami.exe');
516516

517-
let err = false;
518-
let output = '';
519-
520517
try {
521-
output = execSync(`${whoamiPath} /priv`, { timout: 1000 });
518+
const output = execSync(`${whoamiPath} /priv`, { timout: 1000 });
519+
return output.includes('SeCreateSymbolicLinkPrivilege');
522520
} catch (e) {
523-
err = true;
524-
} finally {
525-
if (err || !output.includes('SeCreateSymbolicLinkPrivilege')) {
526-
return false;
527-
}
521+
return false;
528522
}
529523
}
530-
531-
return true;
532524
};
533525

534526
exports.getCallSite = function getCallSite(top) {

0 commit comments

Comments
0 (0)
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.