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@f0c55e2

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
@@ -140,8 +140,10 @@ function _rmchildren(path, options, callback) {
140140

141141
let done = false;
142142

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

146148
rimraf(childPath, options, (err) => {
147149
if (done)
@@ -156,7 +158,7 @@ function _rmchildren(path, options, callback) {
156158
if (numFiles === 0)
157159
rmdir(path, callback);
158160
});
159-
});
161+
}
160162
});
161163
}
162164

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.