Skip to content

Commit b876e35

Browse files
authored
Merge branch 'nodejs:main' into deps-version
2 parents 01f4061 + c7fe303 commit b876e35

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+552
-415
lines changed

BUILDING.md

Lines changed: 98 additions & 98 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -98,15 +98,15 @@ files.
9898

9999
To download `SHASUMS256.txt` using `curl`:
100100

101-
```console
102-
$ curl -O https://nodejs.org/dist/vx.y.z/SHASUMS256.txt
101+
```bash
102+
curl -O https://nodejs.org/dist/vx.y.z/SHASUMS256.txt
103103
```
104104

105105
To check that a downloaded file matches the checksum, run
106106
it through `sha256sum` with a command such as:
107107

108-
```console
109-
$ grep node-vx.y.z.tar.gz SHASUMS256.txt | sha256sum -c -
108+
```bash
109+
grep node-vx.y.z.tar.gz SHASUMS256.txt | sha256sum -c -
110110
```
111111

112112
For Current and LTS, the GPG detached signature of `SHASUMS256.txt` is in
@@ -115,16 +115,16 @@ For Current and LTS, the GPG detached signature of `SHASUMS256.txt` is in
115115
[the GPG keys of individuals authorized to create releases](#release-keys). To
116116
import the keys:
117117

118-
```console
119-
$ gpg --keyserver hkps://keys.openpgp.org --recv-keys 4ED778F539E3634C779C87C6D7062848A1AB005C
118+
```bash
119+
gpg --keyserver hkps://keys.openpgp.org --recv-keys 4ED778F539E3634C779C87C6D7062848A1AB005C
120120
```
121121

122122
See [Release keys](#release-keys) for a script to import active release keys.
123123

124124
Next, download the `SHASUMS256.txt.sig` for the release:
125125

126-
```console
127-
$ curl -O https://nodejs.org/dist/vx.y.z/SHASUMS256.txt.sig
126+
```bash
127+
curl -O https://nodejs.org/dist/vx.y.z/SHASUMS256.txt.sig
128128
```
129129

130130
Then use `gpg --verify SHASUMS256.txt.sig SHASUMS256.txt` to verify

deps/uvwasi/include/uvwasi.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ extern "C" {
1010

1111
#define UVWASI_VERSION_MAJOR 0
1212
#define UVWASI_VERSION_MINOR 0
13-
#define UVWASI_VERSION_PATCH 16
13+
#define UVWASI_VERSION_PATCH 18
1414
#define UVWASI_VERSION_HEX ((UVWASI_VERSION_MAJOR << 16) | \
1515
(UVWASI_VERSION_MINOR << 8) | \
1616
(UVWASI_VERSION_PATCH))

deps/uvwasi/src/uv_mapping.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@
2424
# define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK)
2525
#endif
2626

27+
#if !defined(S_ISFIFO) && defined(S_IFMT) && defined(S_IFIFO)
28+
# define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO)
29+
#endif
30+
2731

2832
uvwasi_errno_t uvwasi__translate_uv_error(int err) {
2933
switch (err) {

deps/uvwasi/src/uvwasi.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1122,7 +1122,7 @@ uvwasi_errno_t uvwasi_fd_prestat_get(uvwasi_t* uvwasi,
11221122
}
11231123

11241124
buf->pr_type = UVWASI_PREOPENTYPE_DIR;
1125-
buf->u.dir.pr_name_len = strlen(wrap->path) + 1;
1125+
buf->u.dir.pr_name_len = strlen(wrap->path);
11261126
err = UVWASI_ESUCCESS;
11271127
exit:
11281128
uv_mutex_unlock(&wrap->mutex);
@@ -1156,7 +1156,7 @@ uvwasi_errno_t uvwasi_fd_prestat_dir_name(uvwasi_t* uvwasi,
11561156
goto exit;
11571157
}
11581158

1159-
size = strlen(wrap->path) + 1;
1159+
size = strlen(wrap->path);
11601160
if (size > (size_t) path_len) {
11611161
err = UVWASI_ENOBUFS;
11621162
goto exit;

doc/api/addons.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -532,8 +532,8 @@ filename to the `sources` array:
532532
Once the `binding.gyp` file is ready, the example addons can be configured and
533533
built using `node-gyp`:
534534

535-
```console
536-
$ node-gyp configure build
535+
```bash
536+
node-gyp configure build
537537
```
538538

539539
### Function arguments

doc/api/cli.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,8 @@ Error: Access to this API has been restricted
184184

185185
The process needs to have access to the `index.js` module:
186186

187-
```console
188-
$ node --experimental-permission --allow-fs-read=/path/to/index.js index.js
187+
```bash
188+
node --experimental-permission --allow-fs-read=/path/to/index.js index.js
189189
```
190190

191191
### `--allow-fs-write`
@@ -314,9 +314,9 @@ added: v10.12.0
314314

315315
Print source-able bash completion script for Node.js.
316316

317-
```console
318-
$ node --completion-bash > node_bash_completion
319-
$ source node_bash_completion
317+
```bash
318+
node --completion-bash > node_bash_completion
319+
source node_bash_completion
320320
```
321321

322322
### `-C condition`, `--conditions=condition`
@@ -339,8 +339,8 @@ The default Node.js conditions of `"node"`, `"default"`, `"import"`, and
339339

340340
For example, to run a module with "development" resolutions:
341341

342-
```console
343-
$ node -C development app.js
342+
```bash
343+
node -C development app.js
344344
```
345345

346346
### `--cpu-prof`
@@ -1854,8 +1854,8 @@ Use `--watch-path` to specify what paths to watch.
18541854
This flag cannot be combined with
18551855
`--check`, `--eval`, `--interactive`, or the REPL.
18561856

1857-
```console
1858-
$ node --watch index.js
1857+
```bash
1858+
node --watch index.js
18591859
```
18601860

18611861
### `--watch-path`
@@ -1877,8 +1877,8 @@ combination with `--watch`.
18771877
This flag cannot be combined with
18781878
`--check`, `--eval`, `--interactive`, `--test`, or the REPL.
18791879

1880-
```console
1881-
$ node --watch-path=./src --watch-path=./tests index.js
1880+
```bash
1881+
node --watch-path=./src --watch-path=./tests index.js
18821882
```
18831883

18841884
This option is only supported on macOS and Windows.
@@ -1889,8 +1889,8 @@ when the option is used on a platform that does not support it.
18891889

18901890
Disable the clearing of the console when watch mode restarts the process.
18911891

1892-
```console
1893-
$ node --watch --watch-preserve-output test.js
1892+
```bash
1893+
node --watch --watch-preserve-output test.js
18941894
```
18951895

18961896
### `--zero-fill-buffers`
@@ -2525,8 +2525,8 @@ garbage collection in an effort to free unused memory.
25252525
On a machine with 2 GiB of memory, consider setting this to
25262526
1536 (1.5 GiB) to leave some memory for other uses and avoid swapping.
25272527

2528-
```console
2529-
$ node --max-old-space-size=1536 index.js
2528+
```bash
2529+
node --max-old-space-size=1536 index.js
25302530
```
25312531

25322532
### `--max-semi-space-size=SIZE` (in megabytes)

doc/api/crypto.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3648,7 +3648,7 @@ const {
36483648
generateKey,
36493649
} = await import('node:crypto');
36503650

3651-
generateKey('hmac', { length: 64 }, (err, key) => {
3651+
generateKey('hmac', { length: 512 }, (err, key) => {
36523652
if (err) throw err;
36533653
console.log(key.export().toString('hex')); // 46e..........620
36543654
});
@@ -3659,7 +3659,7 @@ const {
36593659
generateKey,
36603660
} = require('node:crypto');
36613661

3662-
generateKey('hmac', { length: 64 }, (err, key) => {
3662+
generateKey('hmac', { length: 512 }, (err, key) => {
36633663
if (err) throw err;
36643664
console.log(key.export().toString('hex')); // 46e..........620
36653665
});
@@ -3922,7 +3922,7 @@ const {
39223922
generateKeySync,
39233923
} = await import('node:crypto');
39243924

3925-
const key = generateKeySync('hmac', { length: 64 });
3925+
const key = generateKeySync('hmac', { length: 512 });
39263926
console.log(key.export().toString('hex')); // e89..........41e
39273927
```
39283928

@@ -3931,7 +3931,7 @@ const {
39313931
generateKeySync,
39323932
} = require('node:crypto');
39333933

3934-
const key = generateKeySync('hmac', { length: 64 });
3934+
const key = generateKeySync('hmac', { length: 512 });
39353935
console.log(key.export().toString('hex')); // e89..........41e
39363936
```
39373937

doc/api/esm.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -711,7 +711,7 @@ all `import` calls. They won't apply to `require` calls; those still follow
711711
712712
Loaders follow the pattern of `--require`:
713713
714-
```console
714+
```bash
715715
node \
716716
--experimental-loader unpkg \
717717
--experimental-loader http-to-https \

doc/api/n-api.md

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -580,7 +580,8 @@ typedef enum {
580580
napi_arraybuffer_expected,
581581
napi_detachable_arraybuffer_expected,
582582
napi_would_deadlock, /* unused */
583-
napi_no_external_buffers_allowed
583+
napi_no_external_buffers_allowed,
584+
napi_cannot_run_js
584585
} napi_status;
585586
```
586587

@@ -814,6 +815,18 @@ typedef void (*napi_finalize)(napi_env env,
814815
Unless for reasons discussed in [Object Lifetime Management][], creating a
815816
handle and/or callback scope inside the function body is not necessary.
816817

818+
Since these functions may be called while the JavaScript engine is in a state
819+
where it cannot execute JavaScript code, some Node-API calls may return
820+
`napi_pending_exception` even when there is no exception pending.
821+
822+
Change History:
823+
824+
* experimental (`NAPI_EXPERIMENTAL` is defined):
825+
826+
Node-API calls made from a finalizer will return `napi_cannot_run_js` when
827+
the JavaScript engine is unable to execute JavaScript, and will return
828+
`napi_exception_pending` if there is a pending exception.
829+
817830
#### `napi_async_execute_callback`
818831

819832
<!-- YAML
@@ -1952,11 +1965,11 @@ from [`napi_add_async_cleanup_hook`][].
19521965
The Node.js environment may be torn down at an arbitrary time as soon as
19531966
possible with JavaScript execution disallowed, like on the request of
19541967
[`worker.terminate()`][]. When the environment is being torn down, the
1955-
registered `napi_finalize` callbacks of JavaScript objects, Thread-safe
1968+
registered `napi_finalize` callbacks of JavaScript objects, thread-safe
19561969
functions and environment instance data are invoked immediately and
19571970
independently.
19581971

1959-
The invocation of `napi_finalize` callbacks are scheduled after the manually
1972+
The invocation of `napi_finalize` callbacks is scheduled after the manually
19601973
registered cleanup hooks. In order to ensure a proper order of addon
19611974
finalization during environment shutdown to avoid use-after-free in the
19621975
`napi_finalize` callback, addons should register a cleanup hook with

0 commit comments

Comments
 (0)