This is not a full-fledged and fully correct `require`/CJS support
for `node:worker_threads`, but unlocks certain scenarios that
were not working at all previously.
This commit adds initial support for connecting Unix socket over
TLS in `node:tls.connect()` API
---------
Co-authored-by: Divy Srivastava <dj.srivastava23@gmail.com>
Notable changes:
- Introduces a separate op between `Deno.open` and `node:fs.open`.
- Removes redundant `existenceCheckRequired` and `Deno.lstatSync` calls,
as the op layer already handles that when `options.create_new` is true
and uses synchronous I/O when `O_SYNC` is passed.
- Allows passing custom flags to the op (e.g. `O_SYNC`).
- Addresses `prefer-primordials` lint rule.
- Allows
[parallel/test-fs-open.js](https://github.com/nodejs/node/blob/v23.9.0/test/parallel/test-fs-open.js)
test to pass. There are also several tests that have passed before that
I added to the config.toml.
Improves compatibility with Node.js by validating the input parameters,
accepting Buffer type paths, and converting thrown errors correctly.
This PR also addresses `prefer-primordials` lint rule. These changes
allow parallel/test-fs-unlink-type-check.js test to pass.
Towards https://github.com/denoland/deno/issues/29972,
https://github.com/denoland/deno/issues/24236.
1. Removes the access check callback, which was kind of confusing.
1. Requires `CheckedPath` for everything in the `FileSystem` trait to
ensure we're always checking permissions.
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
Note: We found a case where the v8::StackTrace::current_stack_trace(scope, 20) returns the stack trace which only contains ext: entries in op_node_call_is_from_dependency.
Steps to reproduce:
```
touch package.json
deno i npm:vitest
```
```
// foo.test.ts
import { expect, suite, test } from "vitest";
suite("foo", () => {
test("bar", () => {
expect(1 + 2).toEqual(3);
});
});
```
and run
```
deno run -A npm:vitest
```
This causes new Buffer invocation with stack trace only containing ext:deno_node/internal/buffer.mjs as script names.
This PR fixes such case.
The promised based `lchown` and `lutimes` were implemented in #24418 and
#23172 , but haven't been exported through the `node:fs/promises`
namespace.
Signed-off-by: Daniel Osvaldo R <daniel.rahmanto@gmail.com>