Skip to content

Commit 454b4f8

Browse files
nodejs-github-botrichardlau
authored andcommitted
deps: update acorn-walk to 8.3.1
PR-URL: #50457 Reviewed-By: Mohammed Keyvanzadeh <[email protected]> Reviewed-By: Moshe Atlow <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Marco Ippolito <[email protected]>
1 parent cc693eb commit 454b4f8

File tree

6 files changed

+25
-13
lines changed

6 files changed

+25
-13
lines changed

deps/acorn/acorn-walk/CHANGELOG.md

+8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
## 8.3.1 (2023-12-06)
2+
3+
### Bug fixes
4+
5+
Add `Function` and `Class` to the `AggregateType` type, so that they can be used in walkers without raising a type error.
6+
7+
Visitor functions are now called in such a way that their `this` refers to the object they are part of.
8+
19
## 8.3.0 (2023-10-26)
210

311
### New features

deps/acorn/acorn-walk/dist/walk.d.mts

+2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ export type FullAncestorWalkerCallback<TState> = (
1616
type AggregateType = {
1717
Expression: acorn.Expression,
1818
Statement: acorn.Statement,
19+
Function: acorn.Function,
20+
Class: acorn.Class,
1921
Pattern: acorn.Pattern,
2022
ForInit: acorn.VariableDeclaration | acorn.Expression
2123
}

deps/acorn/acorn-walk/dist/walk.d.ts

+2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ export type FullAncestorWalkerCallback<TState> = (
1616
type AggregateType = {
1717
Expression: acorn.Expression,
1818
Statement: acorn.Statement,
19+
Function: acorn.Function,
20+
Class: acorn.Class,
1921
Pattern: acorn.Pattern,
2022
ForInit: acorn.VariableDeclaration | acorn.Expression
2123
}

deps/acorn/acorn-walk/dist/walk.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.acorn = global.acorn || {}, global.acorn.walk = {})));
55
})(this, (function (exports) { 'use strict';
66

7-
// AST walker module for Mozilla Parser API compatible trees
7+
// AST walker module for ESTree compatible trees
88

99
// A simple walk is one where you simply specify callbacks to be
1010
// called on specific nodes. The last two arguments are optional. A
@@ -14,7 +14,7 @@
1414
// Expression: function(node) { ... }
1515
// });
1616
//
17-
// to do something with all expressions. All Parser API node types
17+
// to do something with all expressions. All ESTree node types
1818
// can be used to identify node types, as well as Expression and
1919
// Statement, which denote categories of nodes.
2020
//
@@ -25,9 +25,9 @@
2525
function simple(node, visitors, baseVisitor, state, override) {
2626
if (!baseVisitor) { baseVisitor = base
2727
; }(function c(node, st, override) {
28-
var type = override || node.type, found = visitors[type];
28+
var type = override || node.type;
2929
baseVisitor[type](node, st, c);
30-
if (found) { found(node, st); }
30+
if (visitors[type]) { visitors[type](node, st); }
3131
})(node, state, override);
3232
}
3333

@@ -38,11 +38,11 @@
3838
var ancestors = [];
3939
if (!baseVisitor) { baseVisitor = base
4040
; }(function c(node, st, override) {
41-
var type = override || node.type, found = visitors[type];
41+
var type = override || node.type;
4242
var isNew = node !== ancestors[ancestors.length - 1];
4343
if (isNew) { ancestors.push(node); }
4444
baseVisitor[type](node, st, c);
45-
if (found) { found(node, st || ancestors, ancestors); }
45+
if (visitors[type]) { visitors[type](node, st || ancestors, ancestors); }
4646
if (isNew) { ancestors.pop(); }
4747
})(node, state, override);
4848
}

deps/acorn/acorn-walk/dist/walk.mjs

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// AST walker module for Mozilla Parser API compatible trees
1+
// AST walker module for ESTree compatible trees
22

33
// A simple walk is one where you simply specify callbacks to be
44
// called on specific nodes. The last two arguments are optional. A
@@ -8,7 +8,7 @@
88
// Expression: function(node) { ... }
99
// });
1010
//
11-
// to do something with all expressions. All Parser API node types
11+
// to do something with all expressions. All ESTree node types
1212
// can be used to identify node types, as well as Expression and
1313
// Statement, which denote categories of nodes.
1414
//
@@ -19,9 +19,9 @@
1919
function simple(node, visitors, baseVisitor, state, override) {
2020
if (!baseVisitor) { baseVisitor = base
2121
; }(function c(node, st, override) {
22-
var type = override || node.type, found = visitors[type];
22+
var type = override || node.type;
2323
baseVisitor[type](node, st, c);
24-
if (found) { found(node, st); }
24+
if (visitors[type]) { visitors[type](node, st); }
2525
})(node, state, override);
2626
}
2727

@@ -32,11 +32,11 @@ function ancestor(node, visitors, baseVisitor, state, override) {
3232
var ancestors = [];
3333
if (!baseVisitor) { baseVisitor = base
3434
; }(function c(node, st, override) {
35-
var type = override || node.type, found = visitors[type];
35+
var type = override || node.type;
3636
var isNew = node !== ancestors[ancestors.length - 1];
3737
if (isNew) { ancestors.push(node); }
3838
baseVisitor[type](node, st, c);
39-
if (found) { found(node, st || ancestors, ancestors); }
39+
if (visitors[type]) { visitors[type](node, st || ancestors, ancestors); }
4040
if (isNew) { ancestors.pop(); }
4141
})(node, state, override);
4242
}

deps/acorn/acorn-walk/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
],
1717
"./package.json": "./package.json"
1818
},
19-
"version": "8.3.0",
19+
"version": "8.3.1",
2020
"engines": {
2121
"node": ">=0.4.0"
2222
},

0 commit comments

Comments
 (0)