Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit dddb7eb

Browse filesBrowse files
nodejs-github-botrichardlau
authored andcommitted
deps: update acorn-walk to 8.3.1
PR-URL: #50457 Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
1 parent c86550e commit dddb7eb
Copy full SHA for dddb7eb

6 files changed

+25-13Lines changed: 25 additions & 13 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎deps/acorn/acorn-walk/CHANGELOG.md‎

Copy file name to clipboardExpand all lines: deps/acorn/acorn-walk/CHANGELOG.md
+8Lines changed: 8 additions & 0 deletions
  • Display the source diff
  • Display the rich diff
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
Collapse file

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

Copy file name to clipboardExpand all lines: deps/acorn/acorn-walk/dist/walk.d.mts
+2Lines changed: 2 additions & 0 deletions
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
}
Collapse file

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

Copy file name to clipboardExpand all lines: deps/acorn/acorn-walk/dist/walk.d.ts
+2Lines changed: 2 additions & 0 deletions
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
}
Collapse file

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

Copy file name to clipboardExpand all lines: deps/acorn/acorn-walk/dist/walk.js
+6-6Lines changed: 6 additions & 6 deletions
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
}
Collapse file

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

Copy file name to clipboardExpand all lines: deps/acorn/acorn-walk/dist/walk.mjs
+6-6Lines 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
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
}
Collapse file

‎deps/acorn/acorn-walk/package.json‎

Copy file name to clipboardExpand all lines: deps/acorn/acorn-walk/package.json
+1-1Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.