From cb747d360e95d27653d66fa528afc40dcdcac3a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Nie=C3=9Fen?= Date: Tue, 3 Sep 2024 11:46:01 +0200 Subject: [PATCH 01/19] doc: render type references in SQLite docs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Render JavaScript types as such in the section "Type conversion between JavaScript and SQLite". PR-URL: https://github.com/nodejs/node/pull/54684 Reviewed-By: Michaël Zasso Reviewed-By: Luigi Pinca --- doc/api/sqlite.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/doc/api/sqlite.md b/doc/api/sqlite.md index ac17ecca640d21..6d4a9aca451682 100644 --- a/doc/api/sqlite.md +++ b/doc/api/sqlite.md @@ -308,11 +308,11 @@ exception. | SQLite | JavaScript | | --------- | -------------------- | -| `NULL` | `null` | -| `INTEGER` | `number` or `BigInt` | -| `REAL` | `number` | -| `TEXT` | `string` | -| `BLOB` | `Uint8Array` | +| `NULL` | {null} | +| `INTEGER` | {number} or {bigint} | +| `REAL` | {number} | +| `TEXT` | {string} | +| `BLOB` | {Uint8Array} | [SQL injection]: https://en.wikipedia.org/wiki/SQL_injection [`--experimental-sqlite`]: cli.md#--experimental-sqlite From 5949e169bd886fcc965172f671671b47ac07d2e2 Mon Sep 17 00:00:00 2001 From: Wuli Date: Tue, 3 Sep 2024 21:56:06 +0930 Subject: [PATCH 02/19] typings: correct param type of `SafePromisePrototypeFinally` PR-URL: https://github.com/nodejs/node/pull/54727 Reviewed-By: Antoine du Hamel Reviewed-By: Jake Yuesong Li --- lib/internal/per_context/primordials.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/internal/per_context/primordials.js b/lib/internal/per_context/primordials.js index 89b8b0483c8af9..6a31f17fb863cb 100644 --- a/lib/internal/per_context/primordials.js +++ b/lib/internal/per_context/primordials.js @@ -462,7 +462,7 @@ const SafePromise = makeSafe( * rejected). The resolved value cannot be modified from the callback. * Prefer using async functions when possible. * @param {Promise} thisPromise - * @param {() => void) | undefined | null} onFinally The callback to execute + * @param {(() => void) | undefined | null} onFinally The callback to execute * when the Promise is settled (fulfilled or rejected). * @returns {Promise} A Promise for the completion of the callback. */ From 9e5d2b74fb22fa23b57653c08c2bd58c2971f852 Mon Sep 17 00:00:00 2001 From: RafaelGSS Date: Sun, 25 Aug 2024 18:51:46 -0300 Subject: [PATCH 03/19] 2024-09-03, Version 22.8.0 (Current) Notable changes: net: * (SEMVER-MINOR) exclude ipv6 loopback addresses from server.listen (Giovanni Bucci) https://github.com/nodejs/node/pull/54264 src: * (SEMVER-MINOR) add JS APIs for compile cache and NODE_DISABLE_COMPILE_CACHE (Joyee Cheung) https://github.com/nodejs/node/pull/54501 src,lib: * (SEMVER-MINOR) add performance.uvMetricsInfo (Rafael Gonzaga) https://github.com/nodejs/node/pull/54413 test_runner: * (SEMVER-MINOR) add support for coverage thresholds (Aviv Keller) https://github.com/nodejs/node/pull/54429 * (SEMVER-MINOR) support running tests in process (Colin Ihrig) https://github.com/nodejs/node/pull/53927 * (SEMVER-MINOR) defer inheriting hooks until run() (Colin Ihrig) https://github.com/nodejs/node/pull/53927 vm: * (SEMVER-MINOR) introduce vanilla contexts via vm.constants.DONT_CONTEXTIFY (Joyee Cheung) https://github.com/nodejs/node/pull/54394 PR-URL: https://github.com/nodejs/node/pull/54560 --- CHANGELOG.md | 3 +- doc/api/cli.md | 10 +-- doc/api/module.md | 8 +- doc/api/perf_hooks.md | 2 +- doc/api/test.md | 2 +- doc/api/util.md | 2 +- doc/api/vm.md | 6 +- doc/changelogs/CHANGELOG_V22.md | 146 ++++++++++++++++++++++++++++++++ 8 files changed, 163 insertions(+), 16 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fe3f88074b4205..1dea2d6885ac6e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -38,7 +38,8 @@ release. -22.7.0
+22.8.0
+22.7.0
22.6.0
22.5.1
22.5.0
diff --git a/doc/api/cli.md b/doc/api/cli.md index cecf804c5e88b9..fe78ddcfd52749 100644 --- a/doc/api/cli.md +++ b/doc/api/cli.md @@ -1096,7 +1096,7 @@ report is not generated. See the documentation on ### `--experimental-test-isolation=mode` > Stability: 1.0 - Early development @@ -2221,7 +2221,7 @@ is ignored and concurrency is one. Otherwise, concurrency defaults to ### `--test-coverage-branches=threshold` > Stability: 1 - Experimental @@ -2249,7 +2249,7 @@ files must meet **both** criteria to be included in the coverage report. ### `--test-coverage-functions=threshold` > Stability: 1 - Experimental @@ -2277,7 +2277,7 @@ files must meet **both** criteria to be included in the coverage report. ### `--test-coverage-lines=threshold` > Stability: 1 - Experimental @@ -2867,7 +2867,7 @@ When set, colors will not be used in the REPL. ### `NODE_DISABLE_COMPILE_CACHE=1` > Stability: 1.1 - Active Development diff --git a/doc/api/module.md b/doc/api/module.md index 9b98231f02e52c..ad5ce86c5328a1 100644 --- a/doc/api/module.md +++ b/doc/api/module.md @@ -67,7 +67,7 @@ const siblingModule = require('./sibling-module'); ### `module.constants.compileCacheStatus` > Stability: 1.1 - Active Development @@ -120,7 +120,7 @@ The following constants are returned as the `status` field in the object returne ### `module.enableCompileCache([cacheDir])` > Stability: 1.1 - Active Development @@ -165,7 +165,7 @@ be inheritend into the child workers. The directory can be obtained either from @@ -202,7 +202,7 @@ separately if the same base directory is used to persist the cache, so they can ### `module.getCompileCacheDir()` > Stability: 1.1 - Active Development diff --git a/doc/api/perf_hooks.md b/doc/api/perf_hooks.md index 719c6f11ea946b..e8a9022f4f0a39 100644 --- a/doc/api/perf_hooks.md +++ b/doc/api/perf_hooks.md @@ -890,7 +890,7 @@ initialized. ### `performanceNodeTiming.uvMetricsInfo` * Returns: {Object} diff --git a/doc/api/test.md b/doc/api/test.md index a7af114880ea87..19819202d1d2e1 100644 --- a/doc/api/test.md +++ b/doc/api/test.md @@ -1246,7 +1246,7 @@ added: - v18.9.0 - v16.19.0 changes: - - version: REPLACEME + - version: v22.8.0 pr-url: https://github.com/nodejs/node/pull/53927 description: Added the `isolation` option. - version: v22.6.0 diff --git a/doc/api/util.md b/doc/api/util.md index ee6a91af5159d4..167c26ab72363e 100644 --- a/doc/api/util.md +++ b/doc/api/util.md @@ -1811,7 +1811,7 @@ added: - v21.7.0 - v20.12.0 changes: - - version: REPLACEME + - version: v22.8.0 pr-url: https://github.com/nodejs/node/pull/54389 description: Respect isTTY and environment variables such as NO_COLORS, NODE_DISABLE_COLORS, and FORCE_COLOR. diff --git a/doc/api/vm.md b/doc/api/vm.md index 30dbf724158792..f8575e3815403a 100644 --- a/doc/api/vm.md +++ b/doc/api/vm.md @@ -229,7 +229,7 @@ overhead. + +* `frames` {number} Number of frames returned in the stacktrace. + **Default:** `10`. Allowable range is between 1 and 200. +* Returns: {Object\[]} An array of stacktrace objects + * `functionName` {string} Returns the name of the function associated with this stack frame. + * `scriptName` {string} Returns the name of the resource that contains the script for the + function for this StackFrame. + * `lineNumber` {number} Returns the number, 1-based, of the line for the associate function call. + * `column` {number} Returns the 1-based column offset on the line for the associated function call. + +Returns an array of stacktrace objects containing the stack of +the caller function. + +```js +const util = require('node:util'); + +function exampleFunction() { + const callSites = util.getCallSite(); + + console.log('Call Sites:'); + callSites.forEach((callSite, index) => { + console.log(`CallSite ${index + 1}:`); + console.log(`Function Name: ${callSite.functionName}`); + console.log(`Script Name: ${callSite.scriptName}`); + console.log(`Line Number: ${callSite.lineNumer}`); + console.log(`Column Number: ${callSite.column}`); + }); + // CallSite 1: + // Function Name: exampleFunction + // Script Name: /home/example.js + // Line Number: 5 + // Column Number: 26 + + // CallSite 2: + // Function Name: anotherFunction + // Script Name: /home/example.js + // Line Number: 22 + // Column Number: 3 + + // ... +} + +// A function to simulate another stack layer +function anotherFunction() { + exampleFunction(); +} + +anotherFunction(); +``` + ## `util.getSystemErrorName(err)`