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 — fs: refactor rimraf to avoid using primordials · nodejs/node@375cbb5

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • lib/internal/fs
    • rimraf.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎lib/internal/fs/rimraf.js‎

Copy file name to clipboardExpand all lines: lib/internal/fs/rimraf.js
+5-3Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,10 @@ function _rmchildren(path, options, callback) {
139139

140140
let done = false;
141141

142-
ArrayPrototypeForEach(files, (child) => {
143-
const childPath = Buffer.concat([pathBuf, separator, child]);
142+
const childPathPrefix = Buffer.concat([pathBuf, separator]);
143+
144+
for (let i = 0; i < files.length; i++) {
145+
const childPath = Buffer.concat([childPathPrefix, files[i]]);
144146

145147
rimraf(childPath, options, (err) => {
146148
if (done)
@@ -155,7 +157,7 @@ function _rmchildren(path, options, callback) {
155157
if (numFiles === 0)
156158
rmdir(path, callback);
157159
});
158-
});
160+
}
159161
});
160162
}
161163

0 commit comments

Comments
0 (0)
You are visitor 01402503 — 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.