mirror of
https://github.com/denoland/deno.git
synced 2025-09-26 12:19:12 +00:00
fix(ext/node): don't throw error on invalid path input on exists
and existsSync
(#29971)
Currently `fs.exists` and `fs.existsSync` throws error when invalid path is given to the input. The expected behavior is to: - Call the callback with false on `fs.exists`. - Return false on `fs.existsSync`. Towards #29972, #24236
This commit is contained in:
parent
c03199ea1e
commit
1c16fde60f
4 changed files with 40 additions and 21 deletions
|
@ -46,7 +46,9 @@ export function once(callback) {
|
|||
// In addition to being accessible through util.promisify.custom,
|
||||
// this symbol is registered globally and can be accessed in any environment as
|
||||
// Symbol.for('nodejs.util.promisify.custom').
|
||||
const kCustomPromisifiedSymbol = SymbolFor("nodejs.util.promisify.custom");
|
||||
export const kCustomPromisifiedSymbol = SymbolFor(
|
||||
"nodejs.util.promisify.custom",
|
||||
);
|
||||
// This is an internal Node symbol used by functions returning multiple
|
||||
// arguments, e.g. ['bytesRead', 'buffer'] for fs.read().
|
||||
const kCustomPromisifyArgsSymbol = SymbolFor(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue