mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
deps: update acorn-walk to 8.3.1
PR-URL: https://github.com/nodejs/node/pull/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>
This commit is contained in:
8
deps/acorn/acorn-walk/CHANGELOG.md
vendored
8
deps/acorn/acorn-walk/CHANGELOG.md
vendored
@@ -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
|
||||
|
||||
2
deps/acorn/acorn-walk/dist/walk.d.mts
vendored
2
deps/acorn/acorn-walk/dist/walk.d.mts
vendored
@@ -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
|
||||
}
|
||||
|
||||
2
deps/acorn/acorn-walk/dist/walk.d.ts
vendored
2
deps/acorn/acorn-walk/dist/walk.d.ts
vendored
@@ -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
|
||||
}
|
||||
|
||||
12
deps/acorn/acorn-walk/dist/walk.js
vendored
12
deps/acorn/acorn-walk/dist/walk.js
vendored
@@ -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
|
||||
@@ -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.
|
||||
//
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
12
deps/acorn/acorn-walk/dist/walk.mjs
vendored
12
deps/acorn/acorn-walk/dist/walk.mjs
vendored
@@ -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
|
||||
@@ -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.
|
||||
//
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
2
deps/acorn/acorn-walk/package.json
vendored
2
deps/acorn/acorn-walk/package.json
vendored
@@ -16,7 +16,7 @@
|
||||
],
|
||||
"./package.json": "./package.json"
|
||||
},
|
||||
"version": "8.3.0",
|
||||
"version": "8.3.1",
|
||||
"engines": {
|
||||
"node": ">=0.4.0"
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user