Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: nodejs/node
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 4ec984f5d9f61206584559a51413abdd245c96cd
Choose a base ref
..
head repository: nodejs/node
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 7b35a0075b5f2a465333c28e53eb86e7b7fe08a6
Choose a head ref
Showing 918 changed files with 2,391 additions and 1,137 deletions.
3 changes: 2 additions & 1 deletion configure
Original file line number Diff line number Diff line change
@@ -4,6 +4,7 @@
# Note that the mix of single and double quotes is intentional,
# as is the fact that the ] goes on a new line.
_=[ 'exec' '/bin/sh' '-c' '''
command -v python3.12 >/dev/null && exec python3.12 "$0" "$@"
command -v python3.11 >/dev/null && exec python3.11 "$0" "$@"
command -v python3.10 >/dev/null && exec python3.10 "$0" "$@"
command -v python3.9 >/dev/null && exec python3.9 "$0" "$@"
@@ -23,7 +24,7 @@ except ImportError:
from distutils.spawn import find_executable as which

print('Node.js configure: Found Python {}.{}.{}...'.format(*sys.version_info))
acceptable_pythons = ((3, 11), (3, 10), (3, 9), (3, 8), (3, 7), (3, 6))
acceptable_pythons = ((3, 12), (3, 11), (3, 10), (3, 9), (3, 8), (3, 7), (3, 6))
if sys.version_info[:2] in acceptable_pythons:
import configure
else:
7 changes: 7 additions & 0 deletions deps/corepack/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## [0.23.0](https://github.com/nodejs/corepack/compare/v0.22.0...v0.23.0) (2023-11-05)


### Features

* update package manager versions ([#325](https://github.com/nodejs/corepack/issues/325)) ([450cd33](https://github.com/nodejs/corepack/commit/450cd332d00d3428f49ed09a4235bd12139931c9))

## [0.22.0](https://github.com/nodejs/corepack/compare/v0.21.0...v0.22.0) (2023-10-21)


8 changes: 4 additions & 4 deletions deps/corepack/dist/lib/corepack.cjs
Original file line number Diff line number Diff line change
@@ -41948,7 +41948,7 @@ function String2(descriptor, ...args) {
}

// package.json
var version = "0.22.0";
var version = "0.23.0";

// sources/Engine.ts
var import_fs3 = __toESM(require("fs"));
@@ -41960,7 +41960,7 @@ var import_semver3 = __toESM(require_semver2());
var config_default = {
definitions: {
npm: {
default: "10.2.1+sha1.41fd6626a08d4167b8639edd272ecf9735e7ceaf",
default: "10.2.3+sha1.f30ed73c400685ab52bf3f21cd3fcab1c5b007ce",
fetchLatestFrom: {
type: "npm",
package: "npm"
@@ -41997,7 +41997,7 @@ var config_default = {
}
},
pnpm: {
default: "8.9.2+sha1.5f2fa48d614263457cf5d7fb7be8b878da318d87",
default: "8.10.2+sha1.e0b68270e89c817ff88b7be62466a2128c53af02",
fetchLatestFrom: {
type: "npm",
package: "pnpm"
@@ -42061,7 +42061,7 @@ var config_default = {
package: "yarn"
},
transparent: {
default: "3.6.4+sha224.4b0b0a9cf41b177779b701850108387d3189ba7c93bd1a535fafbf72",
default: "4.0.1+sha224.ca5d6f5a8aecd0801adc32f775675b01961bdc2383867d36f4732a0a",
commands: [
[
"yarn",
2 changes: 1 addition & 1 deletion deps/corepack/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "corepack",
"version": "0.22.0",
"version": "0.23.0",
"homepage": "https://github.com/nodejs/corepack#readme",
"bugs": {
"url": "https://github.com/nodejs/corepack/issues"
12 changes: 6 additions & 6 deletions doc/api/console.md
Original file line number Diff line number Diff line change
@@ -420,18 +420,18 @@ console.table(undefined);

console.table([{ a: 1, b: 'Y' }, { a: 'Z', b: 2 }]);
// β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”
// β”‚ (index) β”‚ a β”‚ b β”‚
// β”‚ (index) β”‚ a β”‚ b β”‚
// β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€
// β”‚ 0 β”‚ 1 β”‚ 'Y' β”‚
// β”‚ 1 β”‚ 'Z' β”‚ 2 β”‚
// β”‚ 0 β”‚ 1 β”‚ 'Y' β”‚
// β”‚ 1 β”‚ 'Z' β”‚ 2 β”‚
// β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”˜

console.table([{ a: 1, b: 'Y' }, { a: 'Z', b: 2 }], ['a']);
// β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”
// β”‚ (index) β”‚ a β”‚
// β”‚ (index) β”‚ a β”‚
// β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€
// β”‚ 0 β”‚ 1 β”‚
// β”‚ 1 β”‚ 'Z' β”‚
// β”‚ 0 β”‚ 1 β”‚
// β”‚ 1 β”‚ 'Z' β”‚
// β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”˜
```

42 changes: 42 additions & 0 deletions doc/api/globals.md
Original file line number Diff line number Diff line change
@@ -637,6 +637,47 @@ logical processors available to the current Node.js instance.
console.log(`This process is running on ${navigator.hardwareConcurrency} logical processors`);
```

### `navigator.language`

<!-- YAML
added: REPLACEME
-->

* {string}

The `navigator.language` read-only property returns a string representing the
preferred language of the Node.js instance. The language will be determined by
the ICU library used by Node.js at runtime based on the
default language of the operating system.

The value is representing the language version as defined in [RFC 5646][].

The fallback value on builds without ICU is `'en-US'`.

```js
console.log(`The preferred language of the Node.js instance has the tag '${navigator.language}'`);
```

### `navigator.languages`

<!-- YAML
added: REPLACEME
-->

* {Array<string>}

The `navigator.languages` read-only property returns an array of strings
representing the preferred languages of the Node.js instance.
By default `navigator.languages` contains only the value of
`navigator.language`, which will be determined by the ICU library used by
Node.js at runtime based on the default language of the operating system.

The fallback value on builds without ICU is `['en-US']`.

```js
console.log(`The preferred languages are '${navigator.languages}'`);
```

### `navigator.platform`

<!-- YAML
@@ -1100,6 +1141,7 @@ A browser-compatible implementation of [`WritableStreamDefaultWriter`][].
[CommonJS module]: modules.md
[ECMAScript module]: esm.md
[Navigator API]: https://html.spec.whatwg.org/multipage/system-state.html#the-navigator-object
[RFC 5646]: https://www.rfc-editor.org/rfc/rfc5646.txt
[Web Crypto API]: webcrypto.md
[`--experimental-websocket`]: cli.md#--experimental-websocket
[`--no-experimental-global-customevent`]: cli.md#--no-experimental-global-customevent
2 changes: 1 addition & 1 deletion doc/changelogs/CHANGELOG_V20.md
Original file line number Diff line number Diff line change
@@ -490,7 +490,7 @@ node --import ./file-that-calls-register.js ./app.js

Using `--import` ensures that the customization hooks are registered before any application code runs, even the entry point.

This feature was contributed by Izaak Schroeder in <https://github.com/nodejs/node/pull/48842> and <https://github.com/nodejs/node/pull/48559>
This feature was contributed by JoΓ£o Lenon and Jacob Smith in <https://github.com/nodejs/node/pull/46826>, Izaak Schroeder and Jacob Smith in <https://github.com/nodejs/node/pull/48842> and <https://github.com/nodejs/node/pull/48559>

#### Module customization `load` hook can now support CommonJS

24 changes: 24 additions & 0 deletions lib/internal/navigator.js
Original file line number Diff line number Diff line change
@@ -5,9 +5,15 @@ const {
StringPrototypeIndexOf,
StringPrototypeSlice,
StringPrototypeToUpperCase,
ObjectFreeze,
globalThis,
Symbol,
} = primordials;

const {
Intl,
} = globalThis;

const {
ERR_ILLEGAL_CONSTRUCTOR,
} = require('internal/errors').codes;
@@ -74,6 +80,8 @@ class Navigator {
#availableParallelism;
#userAgent = `Node.js/${StringPrototypeSlice(nodeVersion, 1, StringPrototypeIndexOf(nodeVersion, '.'))}`;
#platform = getNavigatorPlatform(process);
#language = Intl?.Collator().resolvedOptions().locale || 'en-US';
#languages = ObjectFreeze([this.#language]);

constructor() {
if (arguments[0] === kInitialize) {
@@ -90,6 +98,20 @@ class Navigator {
return this.#availableParallelism;
}

/**
* @return {string}
*/
get language() {
return this.#language;
}

/**
* @return {Array<string>}
*/
get languages() {
return this.#languages;
}

/**
* @return {string}
*/
@@ -107,6 +129,8 @@ class Navigator {

ObjectDefineProperties(Navigator.prototype, {
hardwareConcurrency: kEnumerableProperty,
language: kEnumerableProperty,
languages: kEnumerableProperty,
userAgent: kEnumerableProperty,
platform: kEnumerableProperty,
});
2 changes: 1 addition & 1 deletion src/debug_utils.cc
Original file line number Diff line number Diff line change
@@ -319,7 +319,7 @@ void DumpNativeBacktrace(FILE* fp) {
}

void DumpJavaScriptBacktrace(FILE* fp) {
v8::Isolate* isolate = v8::Isolate::GetCurrent();
v8::Isolate* isolate = v8::Isolate::TryGetCurrent();
if (isolate == nullptr) {
return;
}
4 changes: 4 additions & 0 deletions test/cctest/test_util.cc
Original file line number Diff line number Diff line change
@@ -299,3 +299,7 @@ TEST(UtilTest, SPrintF) {
const std::string with_zero = std::string("a") + '\0' + 'b';
EXPECT_EQ(SPrintF("%s", with_zero), with_zero);
}

TEST(UtilTest, DumpJavaScriptStackWithNoIsolate) {
node::DumpJavaScriptBacktrace(stderr);
}
24 changes: 0 additions & 24 deletions test/parallel/test-blob-buffer-too-large.js

This file was deleted.

8 changes: 0 additions & 8 deletions test/parallel/test-buffer-slow.js
Original file line number Diff line number Diff line change
@@ -30,14 +30,6 @@ for (const [key, value] of sb.entries()) {

// Should work with edge cases
assert.strictEqual(SlowBuffer(0).length, 0);
try {
assert.strictEqual(
SlowBuffer(buffer.kMaxLength).length, buffer.kMaxLength);
} catch (e) {
// Don't match on message as it is from the JavaScript engine. V8 and
// ChakraCore provide different messages.
assert.strictEqual(e.name, 'RangeError');
}

// Should throw with invalid length type
const bufferInvalidTypeMsg = {
52 changes: 49 additions & 3 deletions test/parallel/test-navigator.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
'use strict';

// Flags: --expose-internals

require('../common');
'use strict';

const common = require('../common');
const assert = require('assert');
const { getNavigatorPlatform } = require('internal/navigator');
const { execFile } = require('child_process');

const is = {
number: (value, key) => {
@@ -74,3 +75,48 @@ assert.strictEqual(getNavigatorPlatform({ arch: 'ia32', platform: 'sunos' }), 'S
assert.strictEqual(getNavigatorPlatform({ arch: 'x64', platform: 'sunos' }), 'SunOS x64');
assert.strictEqual(getNavigatorPlatform({ arch: 'ppc', platform: 'aix' }), 'AIX');
assert.strictEqual(getNavigatorPlatform({ arch: 'x64', platform: 'reactos' }), 'Reactos x64');

assert.strictEqual(typeof navigator.language, 'string');
assert.strictEqual(navigator.language.length !== 0, true);

assert.ok(Array.isArray(navigator.languages));
assert.strictEqual(navigator.languages.length, 1);
assert.strictEqual(typeof navigator.languages[0], 'string');
assert.strictEqual(navigator.languages[0].length !== 0, true);

assert.throws(() => {
navigator.languages[0] = 'foo';
}, new TypeError("Cannot assign to read only property '0' of object '[object Array]'"));
assert.notStrictEqual(navigator.languages[0], 'foo');
assert.strictEqual(typeof navigator.languages[0] === 'string', true);
assert.strictEqual(navigator.languages[0].length !== 0, true);

if (common.hasIntl && common.isWindows === false) {
const testLocale = navigator.language === 'de-DE' ?
'en-US' :
'de-DE';
{
const env = { ...process.env, LC_ALL: testLocale };
execFile(
process.execPath,
['--print', `"process.exit(navigator.language === '${testLocale}' ? 0 : 1)"`],
{ env },
common.mustSucceed()
);
}

{
const env = { ...process.env, LC_ALL: testLocale };
execFile(
process.execPath,
['--print', `"process.exit(navigator.languages[0] === '${testLocale}' ? 0 : 1)"`],
{ env },
common.mustSucceed()
);
}
}

Object.defineProperty(navigator, 'language', { value: 'for-testing' });
assert.strictEqual(navigator.language, 'for-testing');
assert.strictEqual(navigator.languages.length, 1);
assert.strictEqual(navigator.languages[0] !== 'for-testing', true);
19 changes: 8 additions & 11 deletions tools/dep_updaters/update-acorn-walk.sh
Original file line number Diff line number Diff line change
@@ -17,7 +17,7 @@ DEPS_DIR="$BASE_DIR/deps"
. "$BASE_DIR/tools/dep_updaters/utils.sh"

NEW_VERSION=$("$NODE" "$NPM" view acorn-walk dist-tags.latest)
CURRENT_VERSION=$("$NODE" -p "require('./deps/acorn/acorn-walk/package.json').version")
CURRENT_VERSION=$("$NODE" "$NPM" --prefix './deps/acorn/acorn-walk/' pkg get version)

# This function exit with 0 if new version and current version are the same
compare_dependency_version "acorn-walk" "$NEW_VERSION" "$CURRENT_VERSION"
@@ -40,21 +40,17 @@ cd "$WORKSPACE"

echo "Fetching acorn-walk source archive..."

DIST_URL=$(curl -sL "https://registry.npmjs.org/acorn-walk/$NEW_VERSION" | perl -n -e '/"dist".*?"tarball":"(.*?)"/ && print $1')
"$NODE" "$NPM" pack "acorn-walk@$NEW_VERSION"

ACORN_WALK_TGZ="acorn-walk.tgz"

curl -sL -o "$ACORN_WALK_TGZ" "$DIST_URL"
ACORN_WALK_TGZ="acorn-walk-$NEW_VERSION.tgz"

log_and_verify_sha256sum "acorn-walk" "$ACORN_WALK_TGZ"

rm -r "$DEPS_DIR/acorn/acorn-walk"/*

tar -xf "$ACORN_WALK_TGZ"

mv "$WORKSPACE/package"/* "$DEPS_DIR/acorn/acorn-walk"

rm "$ACORN_WALK_TGZ"
mv package/* "$DEPS_DIR/acorn/acorn-walk"

echo "All done!"
echo ""
@@ -64,6 +60,7 @@ echo "$ git add -A deps/acorn-walk"
echo "$ git commit -m \"deps: update acorn-walk to $NEW_VERSION\""
echo ""

# The last line of the script should always print the new version,
# as we need to add it to $GITHUB_ENV variable.
echo "NEW_VERSION=$NEW_VERSION"
# Update the version number on maintaining-dependencies.md
# and print the new version as the last line of the script as we need
# to add it to $GITHUB_ENV variable
finalize_version_update "acorn-walk" "$NEW_VERSION"
Loading