Skip to content

Commit 554052d

Browse files
authored
Merge branch 'nodejs:main' into main
2 parents ce416a2 + a98d9f6 commit 554052d

File tree

22 files changed

+277
-41
lines changed

22 files changed

+277
-41
lines changed

deps/icu-small/source/common/unicode/utfiterator.h

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -557,9 +557,11 @@ class UTFImpl<
557557
public:
558558
// Handle ill-formed UTF-8
559559
U_FORCE_INLINE static CP32 sub() {
560-
switch (behavior) {
561-
case UTF_BEHAVIOR_NEGATIVE: return U_SENTINEL;
562-
case UTF_BEHAVIOR_FFFD: return 0xfffd;
560+
if constexpr (behavior == UTF_BEHAVIOR_NEGATIVE) {
561+
return U_SENTINEL;
562+
} else {
563+
static_assert(behavior == UTF_BEHAVIOR_FFFD);
564+
return 0xfffd;
563565
}
564566
}
565567

@@ -736,10 +738,13 @@ class UTFImpl<
736738
public:
737739
// Handle ill-formed UTF-16: One unpaired surrogate.
738740
U_FORCE_INLINE static CP32 sub(CP32 surrogate) {
739-
switch (behavior) {
740-
case UTF_BEHAVIOR_NEGATIVE: return U_SENTINEL;
741-
case UTF_BEHAVIOR_FFFD: return 0xfffd;
742-
case UTF_BEHAVIOR_SURROGATE: return surrogate;
741+
if constexpr (behavior == UTF_BEHAVIOR_NEGATIVE) {
742+
return U_SENTINEL;
743+
} else if constexpr (behavior == UTF_BEHAVIOR_FFFD) {
744+
return 0xfffd;
745+
} else {
746+
static_assert(behavior == UTF_BEHAVIOR_SURROGATE);
747+
return surrogate;
743748
}
744749
}
745750

@@ -822,10 +827,13 @@ class UTFImpl<
822827
public:
823828
// Handle ill-formed UTF-32
824829
U_FORCE_INLINE static CP32 sub(bool forSurrogate, CP32 surrogate) {
825-
switch (behavior) {
826-
case UTF_BEHAVIOR_NEGATIVE: return U_SENTINEL;
827-
case UTF_BEHAVIOR_FFFD: return 0xfffd;
828-
case UTF_BEHAVIOR_SURROGATE: return forSurrogate ? surrogate : 0xfffd;
830+
if constexpr (behavior == UTF_BEHAVIOR_NEGATIVE) {
831+
return U_SENTINEL;
832+
} else if constexpr (behavior == UTF_BEHAVIOR_FFFD) {
833+
return 0xfffd;
834+
} else {
835+
static_assert(behavior == UTF_BEHAVIOR_SURROGATE);
836+
return forSurrogate ? surrogate : 0xfffd;
829837
}
830838
}
831839

deps/icu-small/source/common/unicode/uvernum.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
* This value will change in the subsequent releases of ICU
6060
* @stable ICU 2.6
6161
*/
62-
#define U_ICU_VERSION_MINOR_NUM 2
62+
#define U_ICU_VERSION_MINOR_NUM 3
6363

6464
/** The current ICU patchlevel version as an integer.
6565
* This value will change in the subsequent releases of ICU
@@ -132,7 +132,7 @@
132132
* This value will change in the subsequent releases of ICU
133133
* @stable ICU 2.4
134134
*/
135-
#define U_ICU_VERSION "78.2"
135+
#define U_ICU_VERSION "78.3"
136136

137137
/**
138138
* The current ICU library major version number as a string, for library name suffixes.
@@ -151,7 +151,7 @@
151151
/** Data version in ICU4C.
152152
* @internal ICU 4.4 Internal Use Only
153153
**/
154-
#define U_ICU_DATA_VERSION "78.2"
154+
#define U_ICU_DATA_VERSION "78.3"
155155
#endif /* U_HIDE_INTERNAL_API */
156156

157157
/*===========================================================================
-3.18 KB
Binary file not shown.

deps/icu-small/source/i18n/nfrule.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,12 +158,17 @@ NFRule::makeRules(UnicodeString& description,
158158
UnicodeString sbuf;
159159
int32_t orElseOp = description.indexOf(gVerticalLine);
160160

161+
uint64_t mod = util64_pow(rule1->radix, rule1->exponent);
161162
// we'll actually only split the rule into two rules if its
162163
// base value is an even multiple of its divisor (or it's one
163164
// of the special rules)
165+
if (rule1->baseValue > 0 && rule1->radix != 0 && mod == 0) {
166+
status = U_NUMBER_ARG_OUTOFBOUNDS_ERROR;
167+
return;
168+
}
164169
if ((rule1->baseValue > 0
165170
&& (rule1->radix != 0) // ICU-23109 Ensure next line won't "% 0"
166-
&& (rule1->baseValue % util64_pow(rule1->radix, rule1->exponent)) == 0)
171+
&& (rule1->baseValue % mod == 0))
167172
|| rule1->getType() == kImproperFractionRule
168173
|| rule1->getType() == kDefaultRule) {
169174

doc/api/child_process.md

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -120,23 +120,19 @@ however, `.bat` and `.cmd` files are not executable on their own without a
120120
terminal, and therefore cannot be launched using [`child_process.execFile()`][].
121121
When running on Windows, `.bat` and `.cmd` files can be invoked by:
122122

123-
* using [`child_process.spawn()`][] with the `shell` option set, or
123+
* using [`child_process.spawn()`][] with the `shell` option set (not recommended, see [DEP0190][]), or
124124
* using [`child_process.exec()`][], or
125125
* spawning `cmd.exe` and passing the `.bat` or `.cmd` file as an argument
126-
(which is what the `shell` option and [`child_process.exec()`][] do).
126+
(which is what [`child_process.exec()`][] does internally).
127127

128128
In any case, if the script filename contains spaces, it needs to be quoted.
129129

130130
```cjs
131131
const { exec, spawn } = require('node:child_process');
132132

133-
// 1. child_process.spawn() with the shell option set
134-
const myBat = spawn('my.bat', { shell: true });
135-
136-
// 2. child_process.exec()
137133
exec('my.bat', (err, stdout, stderr) => { /* ... */ });
138134

139-
// 3. spawning cmd.exe and passing the .bat or .cmd file as an argument
135+
// Or, spawning cmd.exe directly:
140136
const bat = spawn('cmd.exe', ['/c', 'my.bat']);
141137

142138
// If the script filename contains spaces, it needs to be quoted
@@ -146,13 +142,9 @@ exec('"my script.cmd" a b', (err, stdout, stderr) => { /* ... */ });
146142
```mjs
147143
import { exec, spawn } from 'node:child_process';
148144

149-
// 1. child_process.spawn() with the shell option set
150-
const myBat = spawn('my.bat', { shell: true });
151-
152-
// 2. child_process.exec()
153145
exec('my.bat', (err, stdout, stderr) => { /* ... */ });
154146

155-
// 3. spawning cmd.exe and passing the .bat or .cmd file as an argument
147+
// Or, spawning cmd.exe directly:
156148
const bat = spawn('cmd.exe', ['/c', 'my.bat']);
157149

158150
// If the script filename contains spaces, it needs to be quoted
@@ -2369,6 +2361,7 @@ Therefore, this feature requires opting in by setting the
23692361
or [`child_process.fork()`][].
23702362

23712363
[Advanced serialization]: #advanced-serialization
2364+
[DEP0190]: deprecations.md#DEP0190
23722365
[Default Windows shell]: #default-windows-shell
23732366
[HTML structured clone algorithm]: https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm
23742367
[Shell requirements]: #shell-requirements

doc/api/cli.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4074,7 +4074,7 @@ that run in libuv's threadpool will experience degraded performance. In order to
40744074
mitigate this issue, one potential solution is to increase the size of libuv's
40754075
threadpool by setting the `'UV_THREADPOOL_SIZE'` environment variable to a value
40764076
greater than `4` (its current default value). However, setting this from inside
4077-
the process using `process.env.UV_THREADPOOL_SIZE=size` is not guranteed to work
4077+
the process using `process.env.UV_THREADPOOL_SIZE=size` is not guaranteed to work
40784078
as the threadpool would have been created as part of the runtime initialisation
40794079
much before user code is run. For more information, see the [libuv threadpool documentation][].
40804080

doc/api/packages.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1012,7 +1012,7 @@ added: v0.4.0
10121012
The `"main"` field defines the entry point of a package when imported by name
10131013
via a `node_modules` lookup. Its value is a path.
10141014

1015-
The [`"exports"`][] field, if it exists, takes precedence over the
1015+
The [`"exports"`][] field, if it exists, takes precedence over the
10161016
`"main"` field when importing the package by name.
10171017

10181018
It also defines the script that is used when the [package directory is loaded

doc/api/vm.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1835,10 +1835,10 @@ It does several things at once:
18351835

18361836
1. Creates a new context.
18371837
2. If `contextObject` is an object, [contextifies][contextified] it with the new context.
1838-
If `contextObject` is undefined, creates a new object and [contextifies][contextified] it.
1838+
If `contextObject` is undefined, creates a new object and [contextifies][contextified] it.
18391839
If `contextObject` is [`vm.constants.DONT_CONTEXTIFY`][], don't [contextify][contextified] anything.
1840-
3. Compiles the code as a`vm.Script`
1841-
4. Runs the compield code within the created context. The code does not have access to the scope in
1840+
3. Compiles the code as a `vm.Script`
1841+
4. Runs the compiled code within the created context. The code does not have access to the scope in
18421842
which this method is called.
18431843
5. Returns the result.
18441844

doc/contributing/releases.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -314,22 +314,22 @@ git checkout -b v1.2.3-proposal upstream/v1.x-staging
314314
You can also run:
315315

316316
```bash
317-
git node release -S --prepare --security --filterLabel vX.x
317+
git node release -S --prepare --security=../vulnerabilities.json --filterLabel vX.x
318318
```
319319

320320
Example:
321321

322322
```bash
323323
git checkout v20.x
324-
git node release -S --prepare --security --filterLabel v20.x
324+
git node release -S --prepare --security=../vulnerabilities.json --filterLabel v20.x
325325
```
326326

327327
to automate the remaining steps until step 6 or you can perform it manually
328328
following the below steps. For semver-minors, you can pass the new version
329329
explicitly with `--newVersion` arg:
330330

331331
```bash
332-
git node release -S --prepare --security --filterLabel v20.x --newVersion 20.20.0
332+
git node release -S --prepare --security=../vulnerabilities.json --filterLabel v20.x --newVersion 20.20.0
333333
```
334334

335335
<details>

doc/node.1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2287,7 +2287,7 @@ that run in libuv's threadpool will experience degraded performance. In order to
22872287
mitigate this issue, one potential solution is to increase the size of libuv's
22882288
threadpool by setting the \fB'UV_THREADPOOL_SIZE'\fR environment variable to a value
22892289
greater than \fB4\fR (its current default value). However, setting this from inside
2290-
the process using \fBprocess.env.UV_THREADPOOL_SIZE=size\fR is not guranteed to work
2290+
the process using \fBprocess.env.UV_THREADPOOL_SIZE=size\fR is not guaranteed to work
22912291
as the threadpool would have been created as part of the runtime initialisation
22922292
much before user code is run. For more information, see the libuv threadpool documentation.
22932293
.

0 commit comments

Comments
 (0)