diff --git a/lib/fs.js b/lib/fs.js index 53e4d5b829b5f1..541a186bbcb97f 100644 --- a/lib/fs.js +++ b/lib/fs.js @@ -3115,10 +3115,7 @@ function glob(pattern, options, callback) { // TODO: Use iterator helpers when available (async () => { try { - const res = []; - for await (const entry of new Glob(pattern, options).glob()) { - ArrayPrototypePush(res, entry); - } + const res = await Array.fromAsync(new Glob(pattern, options).glob()); callback(null, res); } catch (err) { callback(err);