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‎

Lines changed: 8 additions & 0 deletions
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‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ export type FullAncestorWalkerCallback<TState> = (
1616
typeAggregateType={
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‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ export type FullAncestorWalkerCallback<TState> = (
1616
typeAggregateType={
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‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
(global=typeofglobalThis!=='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
functionsimple(node,visitors,baseVisitor,state,override){
2626
if(!baseVisitor){baseVisitor=base
2727
;}(functionc(node,st,override){
28-
vartype=override||node.type,found=visitors[type];
28+
vartype=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
varancestors=[];
3939
if(!baseVisitor){baseVisitor=base
4040
;}(functionc(node,st,override){
41-
vartype=override||node.type,found=visitors[type];
41+
vartype=override||node.type;
4242
varisNew=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‎

Lines changed: 6 additions & 6 deletions
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
functionsimple(node,visitors,baseVisitor,state,override){
2020
if(!baseVisitor){baseVisitor=base
2121
;}(functionc(node,st,override){
22-
vartype=override||node.type,found=visitors[type];
22+
vartype=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
varancestors=[];
3333
if(!baseVisitor){baseVisitor=base
3434
;}(functionc(node,st,override){
35-
vartype=override||node.type,found=visitors[type];
35+
vartype=override||node.type;
3636
varisNew=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‎

Lines changed: 1 addition & 1 deletion
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)