Commit graph

311 commits

Author SHA1 Message Date
Divy Srivastava
f3920ef2ec
fix(ext/node): validate randomUUID() options (#29656)
Enables `parallel/test-crypto-randomuuid.js`

Ref https://github.com/denoland/deno/issues/29637
2025-06-08 21:06:52 +05:30
Yoshiya Hinosawa
a2faf237b5
fix(ext/node): fix addAbortListener (#29634) 2025-06-06 21:31:41 +09:00
Yoshiya Hinosawa
8e69075889
fix(ext/node): handle -p flag in spawn, fix "from dependency" check in windows (#29611)
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.
2025-06-06 11:53:04 +09:00
Divy Srivastava
5039ce8e32
fix(ext/node): fix Buffer.inspect compatiblity (#29617)
Enables `parallel/test-buffer-inspect.js`

Towards #29589
2025-06-05 14:44:06 +05:30
Divy Srivastava
426e3e7228
fix(ext/node): Buffer.fill compatibility fixes (#29525)
Enables `parallel/test-buffer-fill.js`

Towards https://github.com/denoland/deno/issues/29589
2025-06-05 13:29:44 +05:30
Divy Srivastava
104084876c
fix(ext/node): mark pool ArrayBuffer as untransferable (#29612)
Enables `parallel/test-buffer-pool-untransferable.js`

Towards https://github.com/denoland/deno/issues/29589
2025-06-05 11:44:48 +05:30
Divy Srivastava
8b81644b59
fix(ext/node): enable Buffer pool for strings (#29592)
Part 1 towards enabling `parallel/test-buffer-pool-untransferable.js`
2025-06-05 12:04:32 +09:00
Yoshiya Hinosawa
1e6aca57e8
fix(ext/node): pass node.js specific flags via NODE_OPTIONS env var in spawn (#29600)
This commit changes the interpretation of command line args when
`child_process.spawn` is called with `Deno.execPath()` executable.

We modify cli args for `spawn(process.execPath, ...)` call to simulate
Node.js cli. This commit adds the handling of `--pending-deprecation` flag.
Now if `--pending-deprecation` is specified, it's set to `NODE_OPTIONS`
env var of the child process, which correctly affects the printing of
deprecation warning of Buffer constructor.
2025-06-05 10:38:34 +09:00
James Bronder
5bd9a337c1
fix(ext/node): use primordials in ext/node/polyfills/internal/console/constructor.mjs (#29605)
Towards #24236. Replaces JS builtins with equivalent primordials.
2025-06-05 01:12:58 +02:00
Yoshiya Hinosawa
ff8160b594
fix(ext/node): support DEP0005 deprecation warning (#29530)
Some checks are pending
ci / test release linux-aarch64 (push) Blocked by required conditions
ci / test debug macos-aarch64 (push) Blocked by required conditions
ci / test release macos-aarch64 (push) Blocked by required conditions
ci / bench release linux-x86_64 (push) Blocked by required conditions
ci / lint debug linux-x86_64 (push) Blocked by required conditions
ci / lint debug macos-x86_64 (push) Blocked by required conditions
ci / lint debug windows-x86_64 (push) Blocked by required conditions
ci / test debug linux-x86_64 (push) Blocked by required conditions
ci / test release linux-x86_64 (push) Blocked by required conditions
ci / test debug macos-x86_64 (push) Blocked by required conditions
ci / test release macos-x86_64 (push) Blocked by required conditions
ci / test debug windows-x86_64 (push) Blocked by required conditions
ci / test release windows-x86_64 (push) Blocked by required conditions
ci / pre-build (push) Waiting to run
ci / test debug linux-aarch64 (push) Blocked by required conditions
ci / build wasm32 (push) Blocked by required conditions
ci / publish canary (push) Blocked by required conditions
This commit adds support of `DEP0005` warning which is emitted when the user
calls `Buffer` as constructor.
2025-06-04 12:25:32 +09:00
Yoshiya Hinosawa
a756a7bf8e
fix(ext/node): fix prototype of asymmetricKeyDetails of AsymmetricKeyObject (#29576) 2025-06-03 21:45:28 +09:00
Divy Srivastava
0e92f1a312
fix(ext/node): make Buffer work with resizable ABs (#29578)
Some checks are pending
ci / test release macos-aarch64 (push) Blocked by required conditions
ci / bench release linux-x86_64 (push) Blocked by required conditions
ci / lint debug linux-x86_64 (push) Blocked by required conditions
ci / lint debug macos-x86_64 (push) Blocked by required conditions
ci / lint debug windows-x86_64 (push) Blocked by required conditions
ci / test debug linux-x86_64 (push) Blocked by required conditions
ci / test release linux-x86_64 (push) Blocked by required conditions
ci / test debug macos-x86_64 (push) Blocked by required conditions
ci / test release macos-x86_64 (push) Blocked by required conditions
ci / test debug windows-x86_64 (push) Blocked by required conditions
ci / test release windows-x86_64 (push) Blocked by required conditions
ci / build wasm32 (push) Blocked by required conditions
ci / publish canary (push) Blocked by required conditions
ci / pre-build (push) Waiting to run
ci / test debug linux-aarch64 (push) Blocked by required conditions
ci / test release linux-aarch64 (push) Blocked by required conditions
ci / test debug macos-aarch64 (push) Blocked by required conditions
2025-06-03 09:45:39 +00:00
James Bronder
1d72dcac25
fix(ext/node): use primordials in ext/node/polyfills/internal/process/per_thread.mjs (#29550)
Towards #24236. Replaces JS builtins with equivalent primordial
versions.
2025-06-02 11:14:44 +02:00
Yoshiya Hinosawa
01a6379505
fix(ext/node): print warnings to stderr (#29527)
Some checks are pending
ci / bench release linux-x86_64 (push) Blocked by required conditions
ci / lint debug linux-x86_64 (push) Blocked by required conditions
ci / test release macos-x86_64 (push) Blocked by required conditions
ci / test debug windows-x86_64 (push) Blocked by required conditions
ci / test release windows-x86_64 (push) Blocked by required conditions
ci / pre-build (push) Waiting to run
ci / test debug linux-aarch64 (push) Blocked by required conditions
ci / test release linux-aarch64 (push) Blocked by required conditions
ci / test debug macos-aarch64 (push) Blocked by required conditions
ci / test release macos-aarch64 (push) Blocked by required conditions
ci / lint debug macos-x86_64 (push) Blocked by required conditions
ci / lint debug windows-x86_64 (push) Blocked by required conditions
ci / test debug linux-x86_64 (push) Blocked by required conditions
ci / test release linux-x86_64 (push) Blocked by required conditions
ci / test debug macos-x86_64 (push) Blocked by required conditions
ci / build wasm32 (push) Blocked by required conditions
ci / publish canary (push) Blocked by required conditions
2025-06-02 11:36:47 +09:00
Yoshiya Hinosawa
0a5bf5efd0
fix(ext/node): improve getaddrinfo compatibility (#29501)
This commit improves the compatibility of `cares_wrap` internal binding and
`getaddrinfo` function.

`cares_wrap.getaddrinfo` needs to be mocked in test case. This commit
enables it, and also fixes the 5th argument of `getaddrinfo`.
2025-06-02 11:34:36 +09:00
Divy Srivastava
ba9c80eda8
fix(ext/node): fix function error message in invalidArgTypeHelper (#29526)
Some checks are pending
ci / test release linux-aarch64 (push) Blocked by required conditions
ci / test debug macos-aarch64 (push) Blocked by required conditions
ci / pre-build (push) Waiting to run
ci / test debug linux-aarch64 (push) Blocked by required conditions
ci / test release macos-aarch64 (push) Blocked by required conditions
ci / bench release linux-x86_64 (push) Blocked by required conditions
ci / lint debug linux-x86_64 (push) Blocked by required conditions
ci / lint debug macos-x86_64 (push) Blocked by required conditions
ci / lint debug windows-x86_64 (push) Blocked by required conditions
ci / test debug linux-x86_64 (push) Blocked by required conditions
ci / test release linux-x86_64 (push) Blocked by required conditions
ci / test debug macos-x86_64 (push) Blocked by required conditions
ci / test release macos-x86_64 (push) Blocked by required conditions
ci / test debug windows-x86_64 (push) Blocked by required conditions
ci / test release windows-x86_64 (push) Blocked by required conditions
ci / build wasm32 (push) Blocked by required conditions
ci / publish canary (push) Blocked by required conditions
Fixes `parallel/test-buffer-from.js` in daily Node compat tests runs.
The test was already enabled in CI but that used a different helper than
the daily Node compat tests runners - updated now.

```
divy@divy-macbook deno % deno -A ./tools/node_compat_tests.js -f parallel/test-buffer-from
Found 0 sequential tests and 1 parallel tests
Running 1 tests
   1 FAIL parallel/test-buffer-from.js
    FAIL parallel/test-buffer-from.js
    exit code: 1
    error: Uncaught (in promise) AssertionError: Values are not equal:


    [Diff] Actual / Expected


-   The first argument must be of type string or an instance of Buffer, ArrayBuffer, or Array or an Array-like Object. Received type function ([Function (anonymous)])
+   The first argument must be of type string or an instance of Buffer, ArrayBuffer, or Array or an Array-like Object. Received function


    at new AssertionError (ext:deno_node/assertion_error.ts:412:11)
    at toNode (node:assert:48:15)
    at deepStrictEqual (node:assert:267:3)
    at validateThrownError (node:assert:622:9)
    at throws (node:assert:104:9)
    at file:///Users/divy/gh/deno/tests/node_compat/runner/suite/test/parallel/test-buffer-from.js:59:3
    at Array.forEach (<anonymous>)
    at Object.<anonymous> (file:///Users/divy/gh/deno/tests/node_compat/runner/suite/test/parallel/test-buffer-from.js:51:3)
    at Object.<anonymous> (file:///Users/divy/gh/deno/tests/node_compat/runner/suite/test/parallel/test-buffer-from.js:146:4)
    at Module._compile (node:module:745:34)

Filtered tests: 0/1 (0.00%)
Elapsed time: 0.20s
divy@divy-macbook deno % target/debug/deno -A ./tools/node_compat_tests.js -f parallel/test-buffer-from
Found 0 sequential tests and 1 parallel tests
Running 1 tests
   1 PASS parallel/test-buffer-from.js
    PASS parallel/test-buffer-from.js
Filtered tests: 1/1 (100.00%)
Elapsed time: 0.40s
```
2025-05-30 12:13:22 +05:30
Divy Srivastava
b2f668550d
fix(ext/node): Buffer write OOB checks (#29524)
Enables `parallel/test-buffer-write.js` test
2025-05-30 11:28:22 +05:30
Yoshiya Hinosawa
4a80e1d29b
fix(ext/node): correct kMaxLength value of node:buffer (#29504) 2025-05-30 11:37:34 +09:00
Yoshiya Hinosawa
e56dc01cb8
fix(ext/node): add "internal/http2/util" module (#29474) 2025-05-28 21:46:36 +09:00
Yoshiya Hinosawa
077f0c5665
fix(ext/node): ignore some Node.js specific flags (#29461) 2025-05-28 12:02:26 +09:00
Bartek Iwańczuk
1b6736d3f9
fix(ext/node): node:buffer validates INSPECT_MAX_BYTES (#29469)
Some checks are pending
ci / pre-build (push) Waiting to run
ci / test debug linux-aarch64 (push) Blocked by required conditions
ci / test release linux-aarch64 (push) Blocked by required conditions
ci / test debug macos-aarch64 (push) Blocked by required conditions
ci / test release macos-aarch64 (push) Blocked by required conditions
ci / bench release linux-x86_64 (push) Blocked by required conditions
ci / lint debug linux-x86_64 (push) Blocked by required conditions
ci / lint debug macos-x86_64 (push) Blocked by required conditions
ci / lint debug windows-x86_64 (push) Blocked by required conditions
ci / test debug linux-x86_64 (push) Blocked by required conditions
ci / test release linux-x86_64 (push) Blocked by required conditions
ci / test debug macos-x86_64 (push) Blocked by required conditions
ci / test release macos-x86_64 (push) Blocked by required conditions
ci / test debug windows-x86_64 (push) Blocked by required conditions
ci / test release windows-x86_64 (push) Blocked by required conditions
ci / build wasm32 (push) Blocked by required conditions
ci / publish canary (push) Blocked by required conditions
Co-authored-by: David Sherret <dsherret@users.noreply.github.com>
2025-05-27 23:31:35 +00:00
James Bronder
ffe8ce6204
fix(ext/node): use primordials in ext/node/polyfills/internal/util.mjs (#29430)
Towards #24236. Replaces JS builtins with equivalent primordials.
2025-05-25 22:30:31 +00:00
James Bronder
7abce12183
fix(ext/node): use primordials in ext/node/polyfills/internal/errors.ts (#29382)
Some checks are pending
ci / pre-build (push) Waiting to run
ci / test debug linux-aarch64 (push) Blocked by required conditions
ci / test release linux-aarch64 (push) Blocked by required conditions
ci / test debug macos-aarch64 (push) Blocked by required conditions
ci / test release macos-aarch64 (push) Blocked by required conditions
ci / bench release linux-x86_64 (push) Blocked by required conditions
ci / lint debug linux-x86_64 (push) Blocked by required conditions
ci / lint debug macos-x86_64 (push) Blocked by required conditions
ci / lint debug windows-x86_64 (push) Blocked by required conditions
ci / test debug linux-x86_64 (push) Blocked by required conditions
ci / test release linux-x86_64 (push) Blocked by required conditions
ci / test debug macos-x86_64 (push) Blocked by required conditions
ci / test release macos-x86_64 (push) Blocked by required conditions
ci / test debug windows-x86_64 (push) Blocked by required conditions
ci / test release windows-x86_64 (push) Blocked by required conditions
ci / build wasm32 (push) Blocked by required conditions
ci / publish canary (push) Blocked by required conditions
2025-05-21 12:49:40 +09:00
James Bronder
3f7b7d612d
fix(ext/node): use primordials in ext/node/polyfills/internal/net.ts (#29297)
Towards #24236. Replaces `Symbol`, `RegExp` and its instance method,
`.test()`, with primordial equivalents.
2025-05-15 09:01:50 +02:00
James Bronder
6fe8fcda33
fix(ext/node): use primordials in ext/node/polyfills/internal/validators.mjs (#29302)
Towards #24236. Replaces JS instrinsics with equivalent primordials.
2025-05-15 09:01:14 +02:00
James Bronder
5437871a52
fix(ext/node): use primordials in ext/node/polyfills/internal/stream_base_commons.ts (#29290)
Towards #24236. Replaces JS intrinsics with primordial equivalents. Lint
"ignore" statements were added for `Readable` stream instances.
2025-05-14 11:54:23 +02:00
James Bronder
df7ddfc7df
fix(ext/node): use primordials in ext/node/polyfills/internal/url.ts (#29146)
Some checks are pending
ci / pre-build (push) Waiting to run
ci / test debug linux-aarch64 (push) Blocked by required conditions
ci / test release linux-aarch64 (push) Blocked by required conditions
ci / test debug macos-aarch64 (push) Blocked by required conditions
ci / test release macos-aarch64 (push) Blocked by required conditions
ci / bench release linux-x86_64 (push) Blocked by required conditions
ci / lint debug linux-x86_64 (push) Blocked by required conditions
ci / lint debug macos-x86_64 (push) Blocked by required conditions
ci / lint debug windows-x86_64 (push) Blocked by required conditions
ci / test debug linux-x86_64 (push) Blocked by required conditions
ci / test release linux-x86_64 (push) Blocked by required conditions
ci / test debug macos-x86_64 (push) Blocked by required conditions
ci / test release macos-x86_64 (push) Blocked by required conditions
ci / test debug windows-x86_64 (push) Blocked by required conditions
ci / test release windows-x86_64 (push) Blocked by required conditions
ci / build wasm32 (push) Blocked by required conditions
ci / publish canary (push) Blocked by required conditions
Towards #24236.
2025-05-13 23:30:44 +00:00
James Bronder
527c7401d5
fix(ext/node): use primordials in ext/node/polyfills/internal/normalize_encoding.mjs (#29283)
Towards #24236. Replaces the `.toLowerCase` method with its equivalent
primordial method.
2025-05-14 00:03:04 +02:00
Yoshiya Hinosawa
1022decc79
fix(ext/node): align input validation of Buffer.compare (#29275)
Some checks are pending
ci / test debug windows-x86_64 (push) Blocked by required conditions
ci / test release macos-x86_64 (push) Blocked by required conditions
ci / test release windows-x86_64 (push) Blocked by required conditions
ci / test debug macos-x86_64 (push) Blocked by required conditions
ci / pre-build (push) Waiting to run
ci / test debug linux-aarch64 (push) Blocked by required conditions
ci / test release linux-aarch64 (push) Blocked by required conditions
ci / test debug macos-aarch64 (push) Blocked by required conditions
ci / test release macos-aarch64 (push) Blocked by required conditions
ci / bench release linux-x86_64 (push) Blocked by required conditions
ci / lint debug linux-x86_64 (push) Blocked by required conditions
ci / lint debug macos-x86_64 (push) Blocked by required conditions
ci / lint debug windows-x86_64 (push) Blocked by required conditions
ci / test debug linux-x86_64 (push) Blocked by required conditions
ci / test release linux-x86_64 (push) Blocked by required conditions
ci / build wasm32 (push) Blocked by required conditions
ci / publish canary (push) Blocked by required conditions
2025-05-13 17:14:19 +09:00
Divy Srivastava
acd0c94b46
fix(ext/node): add AES CTR to supported ciphers list (#29273)
Fix https://github.com/denoland/deno/issues/29047
2025-05-13 09:45:36 +05:30
James Bronder
eb1303b8f2
fix(ext/node): use primordials in ext/node/polyfills/internal/querystring.ts (#29264)
Some checks are pending
ci / test debug linux-x86_64 (push) Blocked by required conditions
ci / test release linux-x86_64 (push) Blocked by required conditions
ci / test debug macos-x86_64 (push) Blocked by required conditions
ci / test release macos-x86_64 (push) Blocked by required conditions
ci / test debug windows-x86_64 (push) Blocked by required conditions
ci / test release windows-x86_64 (push) Blocked by required conditions
ci / pre-build (push) Waiting to run
ci / test debug linux-aarch64 (push) Blocked by required conditions
ci / test release linux-aarch64 (push) Blocked by required conditions
ci / test debug macos-aarch64 (push) Blocked by required conditions
ci / test release macos-aarch64 (push) Blocked by required conditions
ci / bench release linux-x86_64 (push) Blocked by required conditions
ci / lint debug linux-x86_64 (push) Blocked by required conditions
ci / lint debug macos-x86_64 (push) Blocked by required conditions
ci / lint debug windows-x86_64 (push) Blocked by required conditions
ci / build wasm32 (push) Blocked by required conditions
ci / publish canary (push) Blocked by required conditions
2025-05-13 11:06:25 +09:00
James Bronder
865d046ba3
fix(ext/node): use primordials in ext/node/polyfills/internal/timers.mjs (#29269)
Towards #24236. Replaces JS intrinsics with equivalent primordial
versions.
2025-05-13 02:09:51 +02:00
James Bronder
5ab029db22
fix(ext/node): use primordials in ext/node/polyfills/internal/cli_table.ts (#29257)
Towards #24236. Replaces JS intrinsics with their equivalent primordial
versions.
2025-05-12 02:47:28 +02:00
James Bronder
2a01ac4482
fix(ext/node): use primordials in ext/node/polyfills/internal/fs/handle.ts (#29239)
Towards #24236. This PR updates JS intrinsics with their primordial
equivalents.
2025-05-11 13:38:53 +02:00
Bartek Iwańczuk
6bbba3c348
fix(ext/node): add assert.CallTracker (#29226) 2025-05-09 14:55:28 +00:00
James Bronder
ac42843157
fix(ext/node): use primordials in ext/node/polyfills/internal/dgram.ts (#29204)
Towards #24236. Replaces `Symbol` as well as as `Function` and `Map`
instance methods with the primordial equivalents. A "prefer-primordial"
ignore comment was added to the `handle.bind` method call within the
`_createSocketHandle` function since this is a method call on a `UDP`
instance instead of a `bind` call on a `Function` object.

Co-authored-by: Divy Srivastava <dj.srivastava23@gmail.com>
2025-05-08 16:03:55 +02:00
James Bronder
f3943bf6e3
fix(ext/node): use primordials in ext/node/polyfills/internal/idna.ts (#29085)
Towards #24236. This PR replaces JS built-ins, `String` and `Array`,
with the primordial versions.
2025-05-07 16:01:03 +02:00
James Bronder
e498e7d7e6
fix(ext/node): use primordials in ext/node/polyfills/internal/async_hooks.ts (#29191)
Towards #24236. Replaces `Symbol` as well as `Array` and `Function`
methods with their primordial equivalents.
2025-05-07 14:19:26 +02:00
James Bronder
8786d39d4b
fix(ext/node): use primordials in ext/node/polyfills/internal/options.ts (#29119)
Towards #24236. This PR replaces `Map` and `String` methods with their
primordial versions.
2025-05-02 10:08:43 +02:00
James Bronder
a2c0157306
fix(ext/node): use primordials in ext/node/polyfills/internal/http.ts (#29082)
Towards #24236. This PR replaces `Date`, `Date` methods, and `Symbol`s
with their primordial versions.
2025-04-29 18:34:22 +02:00
James Bronder
98cf8f402b
fix(ext/node): use primordials in ext/node/polyfills/internal/hide_stack_frames.ts (#29067) 2025-04-28 16:00:54 +09:00
Bartek Iwańczuk
27651d3c77
refactor(ext/node): use Promise.withResolvers (#28917) 2025-04-15 17:33:53 -04:00
Divy Srivastava
5867988bae
fix(ext/node): Fix Writable.toWeb() (#28914)
Fixes https://github.com/denoland/deno/issues/28905
2025-04-15 20:10:48 +02:00
Divy Srivastava
01b6da9d9b
fix(ext/node): upgrade node:stream (#28855)
Ref https://github.com/denoland/deno/issues/28836

This PR replaces the _stream.mjs bundle with a file-by-file port instead. A codemod transpiles Node.js internals to ESM. The codemod performs three tasks: translating CJS to ESM, remapping internal dependencies, and hoisting lazy requires as imports.

The process is fully automated through the `update_node_stream.ts` script, simplifying future internal updates. The script checks out Node.js from a specific tag defined in the `tests/node_compat/runner`.

Additionally, the update enables new tests in our Node test runner and adds features (like compose()) that were missing from the outdated bundle.

## Performance

There is a 140KB+ binary size increase on aarch64-apple-darwin and nop startup time stays the same.
2025-04-14 21:35:34 +05:30
Divy Srivastava
cedf5c4f6a
fix(ext/node): implement Buffer.copyBytesFrom (#28829)
Enables the full `parallel/test-buffer-from.js` test
2025-04-10 12:05:49 +00:00
Divy Srivastava
b26c30d938
fix(ext/node): return Buffer from crypto cipher APIs (#28826)
Fixes https://github.com/denoland/deno/issues/28633
2025-04-10 08:01:30 +00:00
Yoshiya Hinosawa
cb00561e97
fix(ext/node): support input option in spawnSync (#28792) 2025-04-09 13:42:12 +09:00
0hmX
9bc9faff49
fix(ext/node): add support for --no- prefix (allowNegative option) in parseArgs() (#28811) 2025-04-09 12:24:02 +09:00
Sebastien Guillemot
e2341c7949
fix(ext/node): add createReadStream & createWriteStream methods to the FileHandle class (#28700)
Co-authored-by: Nikolay Karadzhov <nkaradzhov89@gmail.com>
Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com>
2025-04-07 17:13:32 +09:00
Yoshiya Hinosawa
f2d73abdd7
fix(ext/node): better dns.lookup compatibility (#27936) 2025-04-02 11:38:07 +09:00