Skip to content

Commit c332260

Browse files
Merge pull request #1010 from nodejs/main
Create a new pull request by comparing changes across two branches
2 parents a695f6a + 49a9ba4 commit c332260

File tree

117 files changed

+9214
-8882
lines changed

Some content is hidden

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

117 files changed

+9214
-8882
lines changed

BUILDING.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,6 @@ platforms. This is true regardless of entries in the table below.
112112
| GNU/Linux | s390x | kernel >= 4.18[^1], glibc >= 2.28 | Tier 2 | e.g. RHEL 8 |
113113
| GNU/Linux | loong64 | kernel >= 5.19, glibc >= 2.36 | Experimental | |
114114
| Windows | x64 | >= Windows 10/Server 2016 | Tier 1 | [^2],[^3] |
115-
| Windows | x64 | Windows 8.1/Server 2012 | Experimental | |
116115
| Windows | arm64 | >= Windows 10 | Tier 2 | |
117116
| macOS | x64 | >= 11.0 | Tier 1 | For notes about compilation see [^4] |
118117
| macOS | arm64 | >= 11.0 | Tier 1 | |
@@ -594,6 +593,11 @@ rebuild may take a lot more time than previous builds. Additionally,
594593
ran `./configure` with non-default options (such as `--debug`), you will need
595594
to run it again before invoking `make -j4`.
596595

596+
If you received the error `nodejs g++ fatal error compilation terminated cc1plus`
597+
during compilation, this is likely a memory issue and you should either provide
598+
more RAM or create swap space to accommodate toolchain requirements or reduce
599+
the number of parallel build tasks (`-j<n>`).
600+
597601
### Windows
598602

599603
#### Tips

deps/corepack/CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Changelog
22

3+
## [0.29.3](https://github.com/nodejs/corepack/compare/v0.29.2...v0.29.3) (2024-07-21)
4+
5+
6+
### Bug Fixes
7+
8+
* fallback to `shasum` when `integrity` is not defined ([#542](https://github.com/nodejs/corepack/issues/542)) ([eb63873](https://github.com/nodejs/corepack/commit/eb63873c6c617a2f8ac7106e26ccfe8aa3ae1fb9))
9+
* make `DEBUG=corepack` more useful ([#538](https://github.com/nodejs/corepack/issues/538)) ([6019d7b](https://github.com/nodejs/corepack/commit/6019d7b56e85bd8b7b58a1a487922c707e70e30e))
10+
311
## [0.29.2](https://github.com/nodejs/corepack/compare/v0.29.1...v0.29.2) (2024-07-13)
412

513

deps/corepack/dist/lib/corepack.cjs

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

deps/corepack/package.json

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "corepack",
3-
"version": "0.29.2",
3+
"version": "0.29.3",
44
"homepage": "https://github.com/nodejs/corepack#readme",
55
"bugs": {
66
"url": "https://github.com/nodejs/corepack/issues"
@@ -18,35 +18,28 @@
1818
"license": "MIT",
1919
"packageManager": "[email protected]+sha224.934d21773e22af4b69a7032a2d3b4cb38c1f7c019624777cc9916b23",
2020
"devDependencies": {
21-
"@babel/core": "^7.14.3",
22-
"@babel/plugin-transform-modules-commonjs": "^7.14.0",
23-
"@babel/preset-typescript": "^7.13.0",
24-
"@jest/globals": "^29.0.0",
2521
"@types/debug": "^4.1.5",
26-
"@types/jest": "^29.0.0",
2722
"@types/node": "^20.4.6",
2823
"@types/proxy-from-env": "^1",
2924
"@types/semver": "^7.1.0",
30-
"@types/tar": "^6.0.0",
3125
"@types/which": "^3.0.0",
3226
"@yarnpkg/eslint-config": "^2.0.0",
3327
"@yarnpkg/fslib": "^3.0.0-rc.48",
3428
"@zkochan/cmd-shim": "^6.0.0",
35-
"babel-plugin-dynamic-import-node": "^2.3.3",
3629
"better-sqlite3": "^10.0.0",
37-
"clipanion": "^3.0.1",
30+
"clipanion": "patch:clipanion@npm%3A3.2.1#~/.yarn/patches/clipanion-npm-3.2.1-fc9187f56c.patch",
3831
"debug": "^4.1.1",
3932
"esbuild": "^0.21.0",
4033
"eslint": "^8.57.0",
41-
"jest": "^29.0.0",
4234
"proxy-from-env": "^1.1.0",
43-
"semver": "^7.5.2",
35+
"semver": "^7.6.3",
4436
"supports-color": "^9.0.0",
45-
"tar": "^6.2.1",
37+
"tar": "^7.4.0",
4638
"tsx": "^4.16.2",
4739
"typescript": "^5.3.3",
4840
"undici": "^6.19.2",
4941
"v8-compile-cache": "^2.3.0",
42+
"vitest": "^2.0.3",
5043
"which": "^4.0.0"
5144
},
5245
"resolutions": {
@@ -62,7 +55,7 @@
6255
"postpack": "run clean",
6356
"rimraf": "node -e 'for(let i=2;i<process.argv.length;i++)fs.rmSync(process.argv[i],{recursive:true,force:true});'",
6457
"typecheck": "tsc --noEmit",
65-
"test": "jest"
58+
"test": "vitest"
6659
},
6760
"files": [
6861
"dist",

doc/api/cluster.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,7 @@ if (cluster.isPrimary) {
317317
```cjs
318318
const cluster = require('node:cluster');
319319
const http = require('node:http');
320+
const numCPUs = require('node:os').availableParallelism();
320321
const process = require('node:process');
321322

322323
if (cluster.isPrimary) {
@@ -335,7 +336,6 @@ if (cluster.isPrimary) {
335336
}
336337

337338
// Start workers and listen for messages containing notifyRequest
338-
const numCPUs = require('node:os').availableParallelism();
339339
for (let i = 0; i < numCPUs; i++) {
340340
cluster.fork();
341341
}

doc/api/single-executable-applications.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,13 @@ If the paths are not absolute, Node.js will use the path relative to the
190190
current working directory. The version of the Node.js binary used to produce
191191
the blob must be the same as the one to which the blob will be injected.
192192
193+
Note: When generating cross-platform SEAs (e.g., generating a SEA
194+
for `linux-x64` on `darwin-arm64`), `useCodeCache` and `useSnapshot`
195+
must be set to false to avoid generating incompatible executables.
196+
Since code cache and snapshots can only be loaded on the same platform
197+
where they are compiled, the generated executable might crash on startup when
198+
trying to load code cache or snapshots built on a different platform.
199+
193200
### Assets
194201
195202
Users can include assets by adding a key-path dictionary to the configuration

lib/buffer.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ const {
2828
MathFloor,
2929
MathMin,
3030
MathTrunc,
31+
NumberIsInteger,
3132
NumberIsNaN,
3233
NumberMAX_SAFE_INTEGER,
3334
NumberMIN_SAFE_INTEGER,
@@ -208,23 +209,23 @@ function _copy(source, target, targetStart, sourceStart, sourceEnd) {
208209
if (targetStart === undefined) {
209210
targetStart = 0;
210211
} else {
211-
targetStart = toInteger(targetStart, 0);
212+
targetStart = NumberIsInteger(targetStart) ? targetStart : toInteger(targetStart, 0);
212213
if (targetStart < 0)
213214
throw new ERR_OUT_OF_RANGE('targetStart', '>= 0', targetStart);
214215
}
215216

216217
if (sourceStart === undefined) {
217218
sourceStart = 0;
218219
} else {
219-
sourceStart = toInteger(sourceStart, 0);
220+
sourceStart = NumberIsInteger(sourceStart) ? sourceStart : toInteger(sourceStart, 0);
220221
if (sourceStart < 0 || sourceStart > source.length)
221222
throw new ERR_OUT_OF_RANGE('sourceStart', `>= 0 && <= ${source.length}`, sourceStart);
222223
}
223224

224225
if (sourceEnd === undefined) {
225226
sourceEnd = source.length;
226227
} else {
227-
sourceEnd = toInteger(sourceEnd, 0);
228+
sourceEnd = NumberIsInteger(sourceEnd) ? sourceEnd : toInteger(sourceEnd, 0);
228229
if (sourceEnd < 0)
229230
throw new ERR_OUT_OF_RANGE('sourceEnd', '>= 0', sourceEnd);
230231
}

lib/internal/console/constructor.js

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ function lazyUtilColors() {
7878
}
7979

8080
// Track amount of indentation required via `console.group()`.
81-
const kGroupIndent = Symbol('kGroupIndent');
8281
const kGroupIndentationWidth = Symbol('kGroupIndentWidth');
8382
const kFormatForStderr = Symbol('kFormatForStderr');
8483
const kFormatForStdout = Symbol('kFormatForStdout');
@@ -91,7 +90,6 @@ const kBindStreamsEager = Symbol('kBindStreamsEager');
9190
const kBindStreamsLazy = Symbol('kBindStreamsLazy');
9291
const kUseStdout = Symbol('kUseStdout');
9392
const kUseStderr = Symbol('kUseStderr');
94-
const kInternalTimeLogImpl = Symbol('kInternalTimeLogImpl');
9593

9694
const optionsMap = new SafeWeakMap();
9795
function Console(options /* or: stdout, stderr, ignoreErrors = true */) {
@@ -178,6 +176,8 @@ ObjectDefineProperty(Console, SymbolHasInstance, {
178176
const kColorInspectOptions = { colors: true };
179177
const kNoColorInspectOptions = {};
180178

179+
const internalIndentationMap = new SafeWeakMap();
180+
181181
ObjectDefineProperties(Console.prototype, {
182182
[kBindStreamsEager]: {
183183
__proto__: null,
@@ -247,7 +247,6 @@ ObjectDefineProperties(Console.prototype, {
247247
[kCounts]: { __proto__: null, ...consolePropAttributes, value: new SafeMap() },
248248
[kColorMode]: { __proto__: null, ...consolePropAttributes, value: colorMode },
249249
[kIsConsole]: { __proto__: null, ...consolePropAttributes, value: true },
250-
[kGroupIndent]: { __proto__: null, ...consolePropAttributes, value: '' },
251250
[kGroupIndentationWidth]: {
252251
__proto__: null,
253252
...consolePropAttributes,
@@ -268,7 +267,7 @@ ObjectDefineProperties(Console.prototype, {
268267
...consolePropAttributes,
269268
value: function(streamSymbol, string, color = '') {
270269
const ignoreErrors = this._ignoreErrors;
271-
const groupIndent = this[kGroupIndent];
270+
const groupIndent = internalIndentationMap.get(this) || '';
272271

273272
const useStdout = streamSymbol === kUseStdout;
274273
const stream = useStdout ? this._stdout : this._stderr;
@@ -372,11 +371,11 @@ function createWriteErrorHandler(instance, streamSymbol) {
372371
};
373372
}
374373

375-
function timeLogImpl(label, formatted, args) {
374+
function timeLogImpl(consoleRef, label, formatted, args) {
376375
if (args === undefined) {
377-
this.log('%s: %s', label, formatted);
376+
consoleRef.log('%s: %s', label, formatted);
378377
} else {
379-
this.log('%s: %s', label, formatted, ...new SafeArrayIterator(args));
378+
consoleRef.log('%s: %s', label, formatted, ...new SafeArrayIterator(args));
380379
}
381380
}
382381

@@ -407,17 +406,11 @@ const consoleMethods = {
407406
},
408407

409408
timeEnd(label = 'default') {
410-
if (this[kInternalTimeLogImpl] === undefined)
411-
this[kInternalTimeLogImpl] = FunctionPrototypeBind(timeLogImpl, this);
412-
413-
timeEnd(this._times, kTraceConsoleCategory, 'console.timeEnd()', kNone, this[kInternalTimeLogImpl], label, `time::${label}`);
409+
timeEnd(this._times, kTraceConsoleCategory, 'console.timeEnd()', kNone, (label, formatted, args) => timeLogImpl(this, label, formatted, args), label, `time::${label}`);
414410
},
415411

416412
timeLog(label = 'default', ...data) {
417-
if (this[kInternalTimeLogImpl] === undefined)
418-
this[kInternalTimeLogImpl] = FunctionPrototypeBind(timeLogImpl, this);
419-
420-
timeLog(this._times, kTraceConsoleCategory, 'console.timeLog()', kNone, this[kInternalTimeLogImpl], label, `time::${label}`, data);
413+
timeLog(this._times, kTraceConsoleCategory, 'console.timeLog()', kNone, (label, formatted, args) => timeLogImpl(this, label, formatted, args), label, `time::${label}`, data);
421414
},
422415

423416
trace: function trace(...args) {
@@ -489,16 +482,22 @@ const consoleMethods = {
489482
if (data.length > 0) {
490483
ReflectApply(this.log, this, data);
491484
}
492-
this[kGroupIndent] +=
493-
StringPrototypeRepeat(' ', this[kGroupIndentationWidth]);
485+
486+
let currentIndentation = internalIndentationMap.get(this) || '';
487+
currentIndentation += StringPrototypeRepeat(' ', this[kGroupIndentationWidth]);
488+
489+
internalIndentationMap.set(this, currentIndentation);
494490
},
495491

496492
groupEnd() {
497-
this[kGroupIndent] = StringPrototypeSlice(
498-
this[kGroupIndent],
493+
const currentIndentation = internalIndentationMap.get(this) || '';
494+
const newIndentation = StringPrototypeSlice(
495+
currentIndentation,
499496
0,
500-
this[kGroupIndent].length - this[kGroupIndentationWidth],
497+
currentIndentation.length - this[kGroupIndentationWidth],
501498
);
499+
500+
internalIndentationMap.set(this, newIndentation);
502501
},
503502

504503
// https://console.spec.whatwg.org/#table

lib/path.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -775,7 +775,7 @@ const win32 = {
775775
*/
776776
basename(path, suffix) {
777777
if (suffix !== undefined)
778-
validateString(suffix, 'ext');
778+
validateString(suffix, 'suffix');
779779
validateString(path, 'path');
780780
let start = 0;
781781
let end = -1;
@@ -1335,7 +1335,7 @@ const posix = {
13351335
*/
13361336
basename(path, suffix) {
13371337
if (suffix !== undefined)
1338-
validateString(suffix, 'ext');
1338+
validateString(suffix, 'suffix');
13391339
validateString(path, 'path');
13401340

13411341
let start = 0;

lib/url.js

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
const {
2525
Boolean,
2626
Int8Array,
27+
ObjectAssign,
2728
ObjectKeys,
2829
StringPrototypeCharCodeAt,
2930
decodeURIComponent,
@@ -735,11 +736,7 @@ Url.prototype.resolveObject = function resolveObject(relative) {
735736
}
736737

737738
const result = new Url();
738-
const tkeys = ObjectKeys(this);
739-
for (let tk = 0; tk < tkeys.length; tk++) {
740-
const tkey = tkeys[tk];
741-
result[tkey] = this[tkey];
742-
}
739+
ObjectAssign(result, this);
743740

744741
// Hash is always overridden, no matter what.
745742
// even href="" will remove it.
@@ -754,12 +751,13 @@ Url.prototype.resolveObject = function resolveObject(relative) {
754751
// Hrefs like //foo/bar always cut to the protocol.
755752
if (relative.slashes && !relative.protocol) {
756753
// Take everything except the protocol from relative
757-
const rkeys = ObjectKeys(relative);
758-
for (let rk = 0; rk < rkeys.length; rk++) {
759-
const rkey = rkeys[rk];
760-
if (rkey !== 'protocol')
761-
result[rkey] = relative[rkey];
762-
}
754+
const relativeWithoutProtocol = ObjectKeys(relative).reduce((acc, key) => {
755+
if (key !== 'protocol') {
756+
acc[key] = relative[key];
757+
}
758+
return acc;
759+
}, {});
760+
ObjectAssign(result, relativeWithoutProtocol);
763761

764762
// urlParse appends trailing / to urls like http://www.example.com
765763
if (slashedProtocol.has(result.protocol) &&
@@ -781,11 +779,7 @@ Url.prototype.resolveObject = function resolveObject(relative) {
781779
// because that's known to be hostless.
782780
// anything else is assumed to be absolute.
783781
if (!slashedProtocol.has(relative.protocol)) {
784-
const keys = ObjectKeys(relative);
785-
for (let v = 0; v < keys.length; v++) {
786-
const k = keys[v];
787-
result[k] = relative[k];
788-
}
782+
ObjectAssign(result, relative);
789783
result.href = result.format();
790784
return result;
791785
}

0 commit comments

Comments
 (0)