Commit 92348a9
fs: use a default callback for fs.close()
The `fs.close()` function requires a callback. Most often the only thing
that callback does is check and rethrow the error if one occurs. To
eliminate common boilerplate, make the callback optional with a default
that checks and rethrows the error as an uncaught exception.
Signed-off-by: James M Snell <jasnell@gmail.com>
PR-URL: #37174
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Zijian Liu <lxxyxzj@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>1 parent cb632e4 commit 92348a9
2 files changed
+14
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1608 | 1608 | | |
1609 | 1609 | | |
1610 | 1610 | | |
1611 | | - | |
| 1611 | + | |
1612 | 1612 | | |
1613 | 1613 | | |
1614 | 1614 | | |
| 1615 | + | |
| 1616 | + | |
| 1617 | + | |
1615 | 1618 | | |
1616 | 1619 | | |
1617 | 1620 | | |
| |||
1632 | 1635 | | |
1633 | 1636 | | |
1634 | 1637 | | |
| 1638 | + | |
| 1639 | + | |
| 1640 | + | |
1635 | 1641 | | |
1636 | 1642 | | |
1637 | 1643 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
434 | 434 | | |
435 | 435 | | |
436 | 436 | | |
437 | | - | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
438 | 442 | | |
439 | | - | |
| 443 | + | |
| 444 | + | |
440 | 445 | | |
441 | 446 | | |
442 | 447 | | |
| |||
0 commit comments