Skip to content

Commit 9e07b62

Browse files
arturovtAndrewKushnir
authored andcommitted
fix(zone.js): add missing APIs to Node.js fs patch (angular#54396)
This commit updates the list of Node.js `fs` APIs to be patched because they haven't been updated for a long time. It adds `opendir,lutimes,writev`. For example, the `opendir` method was added to Node.js in version 12.12.0 in 2019, causing some of the APIs to potentially be always called within the `<root>` context. **Note:** There are missing unit tests for these changes because in unit tests, `fs` is patched by Bazel's Node.js rules and its `node_patches.cjs`. However, the APIs are successfully patched in the real production code and are called with the correct context. PR Close angular#54396
1 parent 58a8f12 commit 9e07b62

File tree

1 file changed

+4
-1
lines changed
  • packages/zone.js/lib/node

1 file changed

+4
-1
lines changed

packages/zone.js/lib/node/fs.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* found in the LICENSE file at https://angular.io/license
77
*/
88

9-
import {patchMacroTask, zoneSymbol} from '../common/utils';
9+
import {patchMacroTask} from '../common/utils';
1010
import {ZoneType} from '../zone-impl';
1111

1212
export function patchFs(Zone: ZoneType): void {
@@ -36,11 +36,13 @@ export function patchFs(Zone: ZoneType): void {
3636
'futimes',
3737
'lchmod',
3838
'lchown',
39+
'lutimes',
3940
'link',
4041
'lstat',
4142
'mkdir',
4243
'mkdtemp',
4344
'open',
45+
'opendir',
4446
'read',
4547
'readdir',
4648
'readFile',
@@ -55,6 +57,7 @@ export function patchFs(Zone: ZoneType): void {
5557
'utimes',
5658
'write',
5759
'writeFile',
60+
'writev',
5861
];
5962

6063
TO_PATCH_MACROTASK_METHODS.filter(

0 commit comments

Comments
 (0)