Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
85 commits
Select commit Hold shift + click to select a range
1769d74
esm: populate separate cache for require(esm) in imported CJS
joyeecheung Sep 8, 2025
12a2462
module: only put directly require-d ESM into require.cache
joyeecheung Sep 17, 2025
39147c1
module: use sync cjs when importing cts
marco-ippolito Oct 2, 2025
2e91b28
module: handle null source from async loader hooks in sync hooks
joyeecheung Oct 14, 2025
b9240bc
module: fix sync resolve hooks for require with node: prefixes
joyeecheung Dec 22, 2025
9a2e213
module: do not wrap module._load when tracing is not enabled
joyeecheung Jan 26, 2026
5065a0a
module: do not invoke resolve hooks twice for imported cjs
joyeecheung Feb 2, 2026
db72272
deps: use npm undici@six tag in `update-undici.sh`
mcollina May 4, 2026
5f9bb8e
tools: revert tools GHA workflow to ubuntu-latest
richardlau Feb 28, 2026
005508d
doc: remove obsolete Boxstarter automated install
MikeMcC399 Feb 14, 2026
d333f48
deps: V8: cherry-pick 5f1342c20b59
Liedtke Mar 18, 2024
f0dbe81
deps: V8: cherry-pick b2f3aea23a01
thibaudmichaud Mar 21, 2024
71e5a59
deps: V8: cherry-pick c734674e03f9
manoskouk Apr 1, 2024
67c8b2c
deps: V8: cherry-pick 692f3d526a38
sjrd Apr 10, 2024
d358687
deps: V8: cherry-pick cf03d55db2a0
thibaudmichaud Apr 10, 2024
d0c24a2
deps: V8: cherry-pick b8f91e510e0f
thibaudmichaud Apr 16, 2024
5e7db13
deps: V8: backport 910cb91733dc
jakobkummerow Jun 4, 2024
e3d65c7
deps: V8: backport 89dc6eab605c
thibaudmichaud Jun 10, 2024
a2df2d8
deps: V8: backport 323942700cfe
thibaudmichaud Oct 2, 2024
a1799a4
deps: V8: backport 63b8849d73ae
thibaudmichaud Oct 9, 2024
eae2c27
deps: V8: cherry-pick 8e214ec3ec8c
thibaudmichaud Oct 9, 2024
92804cd
deps: V8: cherry-pick e7ccf0af1bdd
thibaudmichaud Oct 10, 2024
2268567
deps: V8: cherry-pick 7cb6188cf913
thibaudmichaud Oct 16, 2024
1d1f445
deps: V8: cherry-pick b96e40d5ac85
backes Oct 16, 2024
dcc60d5
deps: V8: backport 9997fc013952
thibaudmichaud Oct 23, 2024
0860971
deps: V8: backport 1b27e4674f11
thibaudmichaud Feb 10, 2025
ec11f3c
deps: V8: backport 85b390089e51
thibaudmichaud Mar 18, 2025
578a9a9
src: clamp WriteUtf8 capacity to INT_MAX in EncodeInto
semimikoh Apr 7, 2026
daaead3
test: simplify encodeInto large buffer regression test
semimikoh Apr 7, 2026
d568a1b
deps: upgrade npm to 10.9.8
npm-cli-bot Mar 27, 2026
447fb9a
meta: persist sccache daemon until end of build workflows
Renegade334 Feb 4, 2026
89ad7dc
tools: enforce removal of `lts-watch-*` labels on release proposals
aduh95 Feb 6, 2026
cf39566
src: fix flags argument offset in JSUdpWrap
cuiweixie Feb 23, 2026
363f9a9
test: skip `test-url` on `--shared-ada` builds
aduh95 Mar 1, 2026
17c0a61
tools: fix parsing of commit trailers in `lint-release-proposal` GHA
aduh95 Mar 2, 2026
4a09efb
crypto: update root certificates to NSS 3.121
nodejs-github-bot Mar 31, 2026
3a27669
deps: upgrade openssl sources to openssl-3.5.6
nodejs-github-bot Apr 7, 2026
b6957e1
deps: update archs files for openssl-3.5.6
nodejs-github-bot Apr 7, 2026
57fb008
test: update tls junk data error expectations
panva Apr 9, 2026
977ef80
url: process crash via malformed UNC hostname in pathToFileURL()
NickNaso Apr 30, 2026
785b00c
meta: pass release version to release worker
flakey5 Apr 17, 2026
79aa32c
deps: update googletest to 73a63ea05dc8ca29ec1d2c1d66481dd0de1950f1
nodejs-github-bot Mar 14, 2026
ffda97a
deps: update googletest to 2461743991f9aa53e9a3625eafcbacd81a3c74cd
nodejs-github-bot Mar 31, 2026
b8ddbc1
deps: update llhttp to 9.3.1
nodejs-github-bot Feb 18, 2026
3ff8ffd
deps: remove stale OpenSSL arch configs
Renegade334 Feb 19, 2026
d339497
deps: update nbytes to 0.1.3
nodejs-github-bot Feb 20, 2026
1a5cec0
deps: update acorn to 8.16.0
nodejs-github-bot Feb 25, 2026
f49b51d
deps: update acorn-walk to 8.3.5
nodejs-github-bot Feb 25, 2026
22ff2d8
deps: update simdjson to 4.3.1
nodejs-github-bot Feb 25, 2026
bbcce09
deps: update sqlite to 3.52.0
nodejs-github-bot Mar 10, 2026
b819cb9
deps: update amaro to 1.1.6
nodejs-github-bot Feb 3, 2026
ae5c162
deps: update amaro to 1.1.7
nodejs-github-bot Feb 8, 2026
73cac05
deps: update amaro to 1.1.8
nodejs-github-bot Mar 10, 2026
e742ab7
deps: update sqlite to 3.51.3
nodejs-github-bot Mar 17, 2026
0226c8d
deps: update simdjson to 4.5.0
nodejs-github-bot Mar 30, 2026
e4c0d99
deps: update timezone to 2026a
nodejs-github-bot Mar 11, 2026
2fdb5ce
http2: fix FileHandle leak in respondWithFile
Han5991 Feb 8, 2026
32831b5
doc: fix broken links of net.md
samuel871211 Feb 9, 2026
c224450
doc: fix spacing in process message event
avivkeller Feb 10, 2026
3ea39ff
doc: fix dropdown menu being obscured at <600px due to stacking context
leolightwork Feb 10, 2026
9f45080
doc: fix methods being documented as properties in `process.md`
aduh95 Feb 10, 2026
ee02966
http: fix keep-alive socket reuse race in requestOnFinish
martinslota Feb 6, 2026
ecfa766
tools: fix auto-start-ci
aduh95 Feb 20, 2026
57c3035
stream: fix decoded fromList chunk boundary check
watson Feb 22, 2026
4f78090
crypto: fix potential null pointer dereference when BIO_meth_new() fails
ndossche Feb 24, 2026
f22ebdc
doc: fix small logic error in DETECT_MODULE_SYNTAX
Renegade334 Mar 1, 2026
aa2c1ec
lib: fix source map url parse in dynamic imports
legendecas Mar 3, 2026
37c2fd6
esm: fix path normalization in `finalizeResolution`
aduh95 Mar 16, 2026
02797de
doc: fix small environment_variables typo
chohner Mar 18, 2026
a64bdb5
doc: fix overstated Date header requirement in response.sendDate
kovan Mar 24, 2026
ad8f518
zlib: fix use-after-free when reset() is called during write
mcollina Mar 26, 2026
2f1e573
doc: update Juan's security steward info
juanarbol Feb 11, 2026
9fad6ce
doc: clarify async caveats for `events.once()`
Renegade334 Feb 12, 2026
c54652f
doc: remove incorrect mention of `module` in `typescript.md`
robpalme Feb 18, 2026
4045c76
doc: clarify status of feature request issues
aduh95 Feb 22, 2026
70b8e6b
doc: rename invalid `function` parameter
Renegade334 Feb 24, 2026
8e20976
doc: explicitly mention Slack handle
RafaelGSS Feb 25, 2026
1855829
doc: fix module.stripTypeScriptTypes indentation
Renegade334 Feb 25, 2026
491be80
doc: add efekrskl as triager
efekrskl Mar 6, 2026
1fc86fc
doc: add note (and caveat) for `mock.module` about customization hooks
JakobJingleheimer Mar 11, 2026
6ec9a70
doc: clarify fs.ReadStream and fs.WriteStream are not constructable
kovan Mar 17, 2026
d807558
doc: add path to vulnerabilities.json mention
RafaelGSS Mar 22, 2026
9b57979
doc: add Rafael to last security release steward
RafaelGSS Mar 26, 2026
45b3506
doc,src,test: fix dead inspector help URL
semimikoh Apr 20, 2026
fdfa0ff
2026-05-13, Version 22.22.3 'Jod' (LTS)
marco-ippolito May 11, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .github/workflows/auto-start-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,4 @@ jobs:
run: ./tools/actions/start-ci.sh ${{ needs.get-prs-for-ci.outputs.numbers }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
1 change: 1 addition & 0 deletions .github/workflows/build-tarball.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ jobs:
CC: ${{ (github.base_ref == 'main' || github.ref_name == 'main') && 'sccache' || '' }} clang
CXX: ${{ (github.base_ref == 'main' || github.ref_name == 'main') && 'sccache' || '' }} clang++
SCCACHE_GHA_ENABLED: ${{ github.base_ref == 'main' || github.ref_name == 'main' }}
SCCACHE_IDLE_TIMEOUT: '0'
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/coverage-linux-without-intl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ env:
CC: ${{ (github.base_ref == 'main' || github.ref_name == 'main') && 'sccache' || '' }} clang
CXX: ${{ (github.base_ref == 'main' || github.ref_name == 'main') && 'sccache' || '' }} clang++
SCCACHE_GHA_ENABLED: ${{ github.base_ref == 'main' || github.ref_name == 'main' }}
SCCACHE_IDLE_TIMEOUT: '0'

permissions:
contents: read
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/coverage-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ env:
CC: ${{ (github.base_ref == 'main' || github.ref_name == 'main') && 'sccache' || '' }} clang
CXX: ${{ (github.base_ref == 'main' || github.ref_name == 'main') && 'sccache' || '' }} clang++
SCCACHE_GHA_ENABLED: ${{ github.base_ref == 'main' || github.ref_name == 'main' }}
SCCACHE_IDLE_TIMEOUT: '0'

permissions:
contents: read
Expand Down
12 changes: 9 additions & 3 deletions .github/workflows/lint-release-proposal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,19 @@ jobs:
gh api \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
--jq '.commits.[] | { smallSha: .sha[0:10] } + (.commit.message|capture("^(?<title>.+)\n\n(.*\n)*PR-URL: (?<prURL>.+)\n"))' \
--jq '.commits.[] | { smallSha: .sha[0:10] } + (.commit.message|capture("^(?<title>.+)\n\n(.*\n)*PR-URL: (?<prURL>.+)(\n|$)"))' \
"/repos/${GITHUB_REPOSITORY}/compare/v${MAJOR}.x...$GITHUB_SHA" --paginate \
| node tools/actions/lint-release-proposal-commit-list.mjs "$CHANGELOG_PATH" "$GITHUB_SHA" \
| while IFS= read -r PR_URL; do
LABEL="dont-land-on-v${MAJOR}.x" gh pr view \
DONT_LAND_LABEL="dont-land-on-v${MAJOR}.x" LTS_WATCH_LABEL="lts-watch-v${MAJOR}.x" gh pr view \
--json labels,url \
--jq 'if (.labels|map(.name==env.LABEL)|any) then error("\(.url) has the \(env.LABEL) label, forbidding it to be in this release proposal") end' \
--jq '
if (.labels|any(.name==env.DONT_LAND_LABEL)) then
error("\(.url) has the \(env.DONT_LAND_LABEL) label, forbidding it to be in this release proposal")
elif (.labels|any(.name==env.LTS_WATCH_LABEL)) then
error("\(.url) has the \(env.LTS_WATCH_LABEL) label, please remove the label now that the PR is included in a release proposal")
end
' \
"$PR_URL" > /dev/null
done
shell: bash # See https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#exit-codes-and-error-action-preference, we want the pipefail option.
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/post-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@ jobs:
steps:
- name: Trigger update-links workflow on nodejs/release-cloudflare-worker
run: |
gh workflow run update-links.yml --repo nodejs/release-cloudflare-worker
gh workflow run update-links.yml --repo nodejs/release-cloudflare-worker -f version=$VERSION
env:
GITHUB_TOKEN: ${{ secrets.GH_USER_TOKEN }}
VERSION: ${{ inputs.version || github.event.release.tag_name }}

- name: Trigger create-release-post workflow on nodejs/nodejs.org
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-internet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ env:
CC: ${{ (github.base_ref == 'main' || github.ref_name == 'main') && 'sccache' || '' }} clang
CXX: ${{ (github.base_ref == 'main' || github.ref_name == 'main') && 'sccache' || '' }} clang++
SCCACHE_GHA_ENABLED: ${{ github.base_ref == 'main' || github.ref_name == 'main' }}
SCCACHE_IDLE_TIMEOUT: '0'

permissions:
contents: read

jobs:
test-internet:
if: github.event_name == 'schedule' && github.repository == 'nodejs/node' || github.event.pull_request.draft == false
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ env:
CC: ${{ (github.base_ref == 'main' || github.ref_name == 'main') && 'sccache' || '' }} clang
CXX: ${{ (github.base_ref == 'main' || github.ref_name == 'main') && 'sccache' || '' }} clang++
SCCACHE_GHA_ENABLED: ${{ github.base_ref == 'main' || github.ref_name == 'main' }}
SCCACHE_IDLE_TIMEOUT: '0'

permissions:
contents: read
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ jobs:
CC: ${{ (github.base_ref == 'main' || github.ref_name == 'main') && 'sccache' || '' }} gcc
CXX: ${{ (github.base_ref == 'main' || github.ref_name == 'main') && 'sccache' || '' }} g++
SCCACHE_GHA_ENABLED: ${{ github.base_ref == 'main' || github.ref_name == 'main' }}
SCCACHE_IDLE_TIMEOUT: '0'
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/tools.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ permissions:
jobs:
tools-deps-update:
if: github.repository == 'nodejs/node' || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-slim
# cannot use ubuntu-slim here because some update scripts require Docker
runs-on: ubuntu-latest
strategy:
fail-fast: false # Prevent other jobs from aborting if one fails
matrix:
Expand Down
34 changes: 0 additions & 34 deletions BUILDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ file a new issue.
* [Windows Prerequisites](#windows-prerequisites)
* [Option 1: Manual install](#option-1-manual-install)
* [Option 2: Automated install with WinGet](#option-2-automated-install-with-winget)
* [Option 3: Automated install with Boxstarter](#option-3-automated-install-with-boxstarter)
* [Building Node.js](#building-nodejs-2)
* [Using ccache](#using-ccache)
* [Android](#android)
Expand Down Expand Up @@ -726,39 +725,6 @@ To install Node.js prerequisites from PowerShell Terminal:
winget configure .\.configurations\configuration.dsc.yaml
```

##### Option 3: Automated install with Boxstarter

A [Boxstarter](https://boxstarter.org/) script can be used for easy setup of
Windows systems with all the required prerequisites for Node.js development.
This script will install the following [Chocolatey](https://chocolatey.org/)
packages:

* [Git for Windows](https://chocolatey.org/packages/git) with the `git` and
Unix tools added to the `PATH`
* [Python 3.x](https://chocolatey.org/packages/python)
* [Visual Studio 2022 Build Tools](https://chocolatey.org/packages/visualstudio2022buildtools)
with [Visual C++ workload](https://chocolatey.org/packages/visualstudio2022-workload-vctools)
* [NetWide Assembler](https://chocolatey.org/packages/nasm)

To install Node.js prerequisites using
[Boxstarter WebLauncher](https://boxstarter.org/weblauncher), visit
<https://boxstarter.org/package/nr/url?https://github.com/nodejs/node/HEAD/tools/bootstrap/windows_boxstarter>
with a supported browser.

Alternatively, you can use PowerShell. Run those commands from
an elevated (Administrator) PowerShell terminal:

```powershell
Set-ExecutionPolicy Unrestricted -Force
iex ((New-Object System.Net.WebClient).DownloadString('https://boxstarter.org/bootstrapper.ps1'))
get-boxstarter -Force
Install-BoxstarterPackage https://github.com/nodejs/node/HEAD/tools/bootstrap/windows_boxstarter -DisableReboots
refreshenv
```

The entire installation using Boxstarter will take up approximately 10 GB of
disk space.

#### Building Node.js

* Remember to first clone the Node.js repository with the Git command
Expand Down
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ release.
</tr>
<tr>
<td valign="top">
<b><a href="doc/changelogs/CHANGELOG_V22.md#22.22.2">22.22.2</a></b><br/>
<b><a href="doc/changelogs/CHANGELOG_V22.md#22.22.3">22.22.3</a></b><br/>
<a href="doc/changelogs/CHANGELOG_V22.md#22.22.2">22.22.2</a><br/>
<a href="doc/changelogs/CHANGELOG_V22.md#22.22.1">22.22.1</a><br/>
<a href="doc/changelogs/CHANGELOG_V22.md#22.22.0">22.22.0</a><br/>
<a href="doc/changelogs/CHANGELOG_V22.md#22.21.1">22.21.1</a><br/>
Expand Down
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -757,6 +757,8 @@ maintaining the Node.js project.
**Oliver Medhurst** <<honk@goose.icu>> (they/them)
* [daeyeon](https://github.com/daeyeon) -
**Daeyeon Jeong** <<daeyeon.dev@gmail.com>> (he/him)
* [efekrskl](https://github.com/efekrskl) -
**Efe Karasakal** <<hi@efe.dev>> (he/him)
* [gireeshpunathil](https://github.com/gireeshpunathil) -
**Gireesh Punathil** <<gpunathi@in.ibm.com>> (he/him)
* [gurgunday](https://github.com/gurgunday) -
Expand Down Expand Up @@ -889,15 +891,15 @@ releases on a rotation basis as outlined in the
* [bengl](https://github.com/bengl) -
**Bryan English** <<bryan@bryanenglish.com>> (he/him)
* [HeroDevs](https://www.herodevs.com/)
* [marco-ippolito](https://github.com/marco-ippolito) - OpenJSF handle: `Marco Ippolito`
* [juanarbol](https://github.com/juanarbol) - OpenJS Slack handle: `juanarbol`
**Juan José Arboleda** <<soyjuanarbol@gmail.com>> (he/him)
* [marco-ippolito](https://github.com/marco-ippolito) - OpenJS Slack handle: `Marco Ippolito`
**Marco Ippolito** <<marcoippolito54@gmail.com>> (he/him)
* [NodeSource](https://nodesource.com/)
* [juanarbol](https://github.com/juanarbol) -
**Juan José Arboleda** <<soyjuanarbol@gmail.com>> (he/him)
* [RafaelGSS](https://github.com/RafaelGSS) - OpenJSF handle: `RafaelGSS`
* [RafaelGSS](https://github.com/RafaelGSS) - OpenJS Slack handle: `RafaelGSS`
**Rafael Gonzaga** <<rafael.nunu@hotmail.com>> (he/him)
* [Platformatic](https://platformatic.dev/)
* [mcollina](https://github.com/mcollina) - OpenJSF handle: `mcollina`
* [mcollina](https://github.com/mcollina) - OpenJS Slack handle: `mcollina`
**Matteo Collina** <<matteo.collina@gmail.com>> (he/him)
* [Red Hat](https://redhat.com) / [IBM](https://ibm.com)
* [BethGriggs](https://github.com/BethGriggs) -
Expand Down
2 changes: 1 addition & 1 deletion common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@

# Reset this number to 0 on major V8 upgrades.
# Increment by one for each non-official patch applied to deps/v8.
'v8_embedder_string': '-node.39',
'v8_embedder_string': '-node.56',

##### V8 defaults for Node.js #####

Expand Down
10 changes: 10 additions & 0 deletions deps/acorn/acorn-walk/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
## 8.3.5 (2026-02-19)

### Bug fixes

Emit a more informative error message when trying to walk a node type that has no walker function.

Specify callbacks in types to receive `AnyNode` type, so that they can be narrowed more easily.

Support import attributes.

## 8.3.4 (2024-09-09)

### Bug fixes
Expand Down
12 changes: 6 additions & 6 deletions deps/acorn/acorn-walk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ produce a meaningful state. (An example of a use of state is to track
scope at each point in the tree.)

```js
const acorn = require("acorn")
const walk = require("acorn-walk")
import * as acorn from "acorn"
import * as walk from "acorn-walk"

walk.simple(acorn.parse("let x = 10"), {
Literal(node) {
Expand All @@ -62,8 +62,8 @@ a tree, building up an array of ancestor nodes (including the current node)
and passing the array to the callbacks as a third parameter.

```js
const acorn = require("acorn")
const walk = require("acorn-walk")
import * as acorn from "acorn"
import * as walk from "acorn-walk"

walk.ancestor(acorn.parse("foo('hi')"), {
Literal(_node, _state, ancestors) {
Expand Down Expand Up @@ -97,8 +97,8 @@ current node) and passing the array to the callbacks as a third
parameter.

```js
const acorn = require("acorn")
const walk = require("acorn-walk")
import * as acorn from "acorn"
import * as walk from "acorn-walk"

walk.full(acorn.parse("1 + 1"), node => {
console.log(`There's a ${node.type} node at ${node.ch}`)
Expand Down
47 changes: 11 additions & 36 deletions deps/acorn/acorn-walk/dist/walk.d.mts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import * as acorn from "acorn"

export type FullWalkerCallback<TState> = (
node: acorn.Node,
node: acorn.AnyNode,
state: TState,
type: string
) => void

export type FullAncestorWalkerCallback<TState> = (
node: acorn.Node,
node: acorn.AnyNode,
state: TState,
ancestors: acorn.Node[],
ancestors: acorn.AnyNode[],
type: string
) => void

Expand All @@ -29,24 +29,24 @@ export type SimpleVisitors<TState> = {
}

export type AncestorVisitors<TState> = {
[type in acorn.AnyNode["type"]]?: ( node: Extract<acorn.AnyNode, { type: type }>, state: TState, ancestors: acorn.Node[]
[type in acorn.AnyNode["type"]]?: ( node: Extract<acorn.AnyNode, { type: type }>, state: TState, ancestors: acorn.AnyNode[]
) => void
} & {
[type in keyof AggregateType]?: (node: AggregateType[type], state: TState, ancestors: acorn.Node[]) => void
[type in keyof AggregateType]?: (node: AggregateType[type], state: TState, ancestors: acorn.AnyNode[]) => void
}

export type WalkerCallback<TState> = (node: acorn.Node, state: TState) => void
export type WalkerCallback<TState> = (node: acorn.AnyNode, state: TState) => void

export type RecursiveVisitors<TState> = {
[type in acorn.AnyNode["type"]]?: ( node: Extract<acorn.AnyNode, { type: type }>, state: TState, callback: WalkerCallback<TState>) => void
} & {
[type in keyof AggregateType]?: (node: AggregateType[type], state: TState, callback: WalkerCallback<TState>) => void
}

export type FindPredicate = (type: string, node: acorn.Node) => boolean
export type FindPredicate = (type: string, node: acorn.AnyNode) => boolean

export interface Found<TState> {
node: acorn.Node,
node: acorn.AnyNode,
state: TState
}

Expand All @@ -66,10 +66,6 @@ export function simple<TState>(

/**
* does a 'simple' walk over a tree, building up an array of ancestor nodes (including the current node) and passing the array to the callbacks as a third parameter.
* @param node
* @param visitors
* @param base
* @param state
*/
export function ancestor<TState>(
node: acorn.Node,
Expand All @@ -94,10 +90,6 @@ export function recursive<TState>(

/**
* does a 'full' walk over a tree, calling the {@link callback} with the arguments (node, state, type) for each node
* @param node
* @param callback
* @param base
* @param state
*/
export function full<TState>(
node: acorn.Node,
Expand All @@ -108,10 +100,6 @@ export function full<TState>(

/**
* does a 'full' walk over a tree, building up an array of ancestor nodes (including the current node) and passing the array to the callbacks as a third parameter.
* @param node
* @param callback
* @param base
* @param state
*/
export function fullAncestor<TState>(
node: acorn.Node,
Expand All @@ -122,8 +110,6 @@ export function fullAncestor<TState>(

/**
* builds a new walker object by using the walker functions in {@link functions} and filling in the missing ones by taking defaults from {@link base}.
* @param functions
* @param base
*/
export function make<TState>(
functions: RecursiveVisitors<TState>,
Expand All @@ -132,33 +118,22 @@ export function make<TState>(

/**
* tries to locate a node in a tree at the given start and/or end offsets, which satisfies the predicate test. {@link start} and {@link end} can be either `null` (as wildcard) or a `number`. {@link test} may be a string (indicating a node type) or a function that takes (nodeType, node) arguments and returns a boolean indicating whether this node is interesting. {@link base} and {@link state} are optional, and can be used to specify a custom walker. Nodes are tested from inner to outer, so if two nodes match the boundaries, the inner one will be preferred.
* @param node
* @param start
* @param end
* @param type
* @param base
* @param state
*/
export function findNodeAt<TState>(
node: acorn.Node,
start: number | undefined,
end?: number | undefined,
start: number | undefined | null,
end?: number | undefined | null,
type?: FindPredicate | string,
base?: RecursiveVisitors<TState>,
state?: TState
): Found<TState> | undefined

/**
* like {@link findNodeAt}, but will match any node that exists 'around' (spanning) the given position.
* @param node
* @param start
* @param type
* @param base
* @param state
*/
export function findNodeAround<TState>(
node: acorn.Node,
start: number | undefined,
start: number | undefined | null,
type?: FindPredicate | string,
base?: RecursiveVisitors<TState>,
state?: TState
Expand Down
Loading
Loading