Skip to content

Commit

Permalink
deps: update acorn-walk to 8.3.1
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
nodejs-github-bot authored and richardlau committed Apr 26, 2024
1 parent c86550e commit dddb7eb
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 13 deletions.
8 changes: 8 additions & 0 deletions deps/acorn/acorn-walk/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
## 8.3.1 (2023-12-06)

### Bug fixes

Add `Function` and `Class` to the `AggregateType` type, so that they can be used in walkers without raising a type error.

Visitor functions are now called in such a way that their `this` refers to the object they are part of.

## 8.3.0 (2023-10-26)

### New features
Expand Down
2 changes: 2 additions & 0 deletions deps/acorn/acorn-walk/dist/walk.d.mts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ export type FullAncestorWalkerCallback<TState> = (
type AggregateType = {
Expression: acorn.Expression,
Statement: acorn.Statement,
Function: acorn.Function,
Class: acorn.Class,
Pattern: acorn.Pattern,
ForInit: acorn.VariableDeclaration | acorn.Expression
}
Expand Down
2 changes: 2 additions & 0 deletions deps/acorn/acorn-walk/dist/walk.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ export type FullAncestorWalkerCallback<TState> = (
type AggregateType = {
Expression: acorn.Expression,
Statement: acorn.Statement,
Function: acorn.Function,
Class: acorn.Class,
Pattern: acorn.Pattern,
ForInit: acorn.VariableDeclaration | acorn.Expression
}
Expand Down
12 changes: 6 additions & 6 deletions deps/acorn/acorn-walk/dist/walk.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.acorn = global.acorn || {}, global.acorn.walk = {})));
})(this, (function (exports) { 'use strict';

// AST walker module for Mozilla Parser API compatible trees
// AST walker module for ESTree compatible trees

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

Expand All @@ -38,11 +38,11 @@
var ancestors = [];
if (!baseVisitor) { baseVisitor = base
; }(function c(node, st, override) {
var type = override || node.type, found = visitors[type];
var type = override || node.type;
var isNew = node !== ancestors[ancestors.length - 1];
if (isNew) { ancestors.push(node); }
baseVisitor[type](node, st, c);
if (found) { found(node, st || ancestors, ancestors); }
if (visitors[type]) { visitors[type](node, st || ancestors, ancestors); }
if (isNew) { ancestors.pop(); }
})(node, state, override);
}
Expand Down
12 changes: 6 additions & 6 deletions deps/acorn/acorn-walk/dist/walk.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// AST walker module for Mozilla Parser API compatible trees
// AST walker module for ESTree compatible trees

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

Expand All @@ -32,11 +32,11 @@ function ancestor(node, visitors, baseVisitor, state, override) {
var ancestors = [];
if (!baseVisitor) { baseVisitor = base
; }(function c(node, st, override) {
var type = override || node.type, found = visitors[type];
var type = override || node.type;
var isNew = node !== ancestors[ancestors.length - 1];
if (isNew) { ancestors.push(node); }
baseVisitor[type](node, st, c);
if (found) { found(node, st || ancestors, ancestors); }
if (visitors[type]) { visitors[type](node, st || ancestors, ancestors); }
if (isNew) { ancestors.pop(); }
})(node, state, override);
}
Expand Down
2 changes: 1 addition & 1 deletion deps/acorn/acorn-walk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
],
"./package.json": "./package.json"
},
"version": "8.3.0",
"version": "8.3.1",
"engines": {
"node": ">=0.4.0"
},
Expand Down

0 comments on commit dddb7eb

Please sign in to comment.