File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3270,6 +3270,14 @@ function watch(
32703270 // deno-lint-ignore prefer-primordials
32713271 const watchPath = getValidatedPath ( filename ) . toString ( ) ;
32723272
3273+ // Match Node: validate non-boolean `recursive`/`persistent` up front.
3274+ // https://github.com/nodejs/node/blob/main/lib/internal/fs/recursive_watch.js
3275+ if ( options != null && options . recursive != null ) {
3276+ validateBoolean ( options . recursive , "options.recursive" ) ;
3277+ }
3278+ if ( options != null && options . persistent != null ) {
3279+ validateBoolean ( options . persistent , "options.persistent" ) ;
3280+ }
32733281 const recursive = options ?. recursive || false ;
32743282 validateIgnoreOption ( options ?. ignore , "options.ignore" ) ;
32753283 const ignoreMatcher = createIgnoreMatcher ( options ?. ignore ) ;
Original file line number Diff line number Diff line change 12081208 "parallel/test-fs-watch-recursive-add-folder.js" : {},
12091209 "parallel/test-fs-watch-recursive-delete.js" : {},
12101210 "parallel/test-fs-watch-recursive-linux-parallel-remove.js" : {},
1211+ "parallel/test-fs-watch-recursive-validate.js" : {},
12111212 "parallel/test-fs-watch-ref-unref.js" : {},
12121213 "parallel/test-fs-watch-stop-async.js" : {},
12131214 "parallel/test-fs-watch-stop-sync.js" : {},
You can’t perform that action at this time.
0 commit comments