dir[Symbol.asyncDispose]()


如果目录句柄是打开的,则调用 dir.close(),并返回一个在清理完成时会被兑现的 Promise。

🌐 Calls dir.close() if the directory handle is open, and returns a promise that fulfills when disposal is complete.

这种方法使该目录能够与 await using 一起使用,当作用域退出时,await using 会自动关闭该目录。更多信息,请参阅 MDN 上关于 using 语句的文档

🌐 This method enables the directory to be used with await using, which will automatically close the directory when the scope exits. For more information, see the MDN documentation on using statements.