clean up some outdated code and implement a few performance
improvements. most notably, the response from `upgradeWebSocket` is now
actually used as a normal response.
a followup pr will rework raw upgrades to a greater extent
This commit updates V8 to version 14.0.0. This update brings
changes to Temporal support too, which is close to being stabilized.
---------
Co-authored-by: snek <snek@deno.com>
`fs.mkdtemp` and `fs.mkdtempSync` now accept `Buffer` and `Uint8Array`
path. The implementation has been moved to Rust, including directory
suffix generation and directory creation.
Fixes https://github.com/denoland/deno/issues/20594
This implements `JSStreamSocket` which drives the TLS underlying stream
in `rustls_tokio_stream` using 2 sets of channels. One for piping the
encrypted protocol transport and the other for plaintext application
data.
This fixes connecting to `npm:mssql`:
```js
import sql from "npm:mssql";
const sqlConfig = {
server: "localhost",
user: "divy",
password: "123",
database: "master",
options: {
trustServerCertificate: true,
},
};
const pool = await sql.connect(sqlConfig);
const result = await pool.request().query(`SELECT * FROM sys.databases`);
```
Closes#30405
Changes in this PR:
- Fixes `os.setPriority()` on Windows.
- Validates the function parameters correctly and constructs
`NodeSystemError` on op call error.
- Allows [parallel/test-os-process-priority.js](https://github.com/nodejs/node/blob/v24.2.0/test/parallel/test-os-process-priority.js) to pass.
---------
Signed-off-by: Daniel Osvaldo R <daniel.rahmanto@gmail.com>
Previously, Deno throws error when creating `Buffer.allocUnsafe` or
`Buffer.allocUnsafeSlow` with size of `2**31` where that's not the case
with Node.js.
The changes allow these tests to pass:
-
[test-buffer-large-size-buffer-alloc-unsafe-slow.js](https://github.com/nodejs/node/blob/v24.2.0/test/pummel/test-buffer-large-size-buffer-alloc-unsafe-slow.js)
-
[test-buffer-large-size-buffer-alloc-unsafe.js](https://github.com/nodejs/node/blob/v24.2.0/test/pummel/test-buffer-large-size-buffer-alloc-unsafe.js)
-
[test-string-decoder-large-buffer.js](https://github.com/nodejs/node/blob/v24.2.0/test/pummel/test-string-decoder-large-buffer.js)
<!--
Before submitting a PR, please read
https://docs.deno.com/runtime/manual/references/contributing
1. Give the PR a descriptive title.
Examples of good title:
- fix(std/http): Fix race condition in server
- docs(console): Update docstrings
- feat(doc): Handle nested reexports
Examples of bad title:
- fix#7123
- update docs
- fix bugs
2. Ensure there is a related issue and it is referenced in the PR text.
3. Ensure there are tests that cover the changes.
4. Ensure `cargo test` passes.
5. Ensure `./tools/format.js` passes without changing files.
6. Ensure `./tools/lint.js` passes.
7. Open as a draft PR if your work is still in progress. The CI won't
run
all steps, but you can add '[ci]' to a commit message to force it to.
8. If you would like to run the benchmarks on the CI, add the 'ci-bench'
label.
-->
Fixes#30299
I decided to build the `OpenOptions` on the Rust side, because it's
cheaper to pass integers to the op function and we can enable the fast
op call. Also the tests that I added to the `config.toml` were already
passing before this PR.
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.
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.
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.
Fixes#16899.
Fixes https://github.com/denoland/deno/issues/23524.
Fixes https://github.com/denoland/deno/issues/23938.
Fixes https://github.com/denoland/deno/issues/27869.
Unblocks #5501.
This PR adds support for additional stdio pipes to windows, as well as
the detached option in `node:child_process`. I also ported over the
`kill` implementation for windows, which means we now can support
`kill(0)` as well as some other signals.
This means that playwright will now work on windows.
Now that we have a way to support detached processes on all platforms,
we can also easily add a `detached` option to `Deno.Command`, similar to
`child_process.spawn`.
---
The reason for moving away from `std::process::Command` is that the
standard library doesn't expose what we need to control the file
descriptor table of child processes on windows. The implementation here
is based off of parts of `std` and parts of `libuv`, and allows us to
support passing extra pipes in addition to detached processes on
windows.
This PR updates `op_node_call_is_from_dependency` op, which now detects
node_modules path on windows correctly.
This PR also updates the handling of
`child_process.spawn(process.execPath, ["-p", souceCode])`. It runs the
given string as source code, and prints the last evaluated value. This
PR adds wrapper for simulating that behavior.