Skip to content

Commit

Permalink
Add support for ES2022 StaticBlock
Browse files Browse the repository at this point in the history
  • Loading branch information
willdurand committed Apr 4, 2022
1 parent ec3f900 commit d7f27b4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion estraverse.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@
ReturnStatement: 'ReturnStatement',
SequenceExpression: 'SequenceExpression',
SpreadElement: 'SpreadElement',
StaticBlock: 'StaticBlock',
Super: 'Super',
SwitchStatement: 'SwitchStatement',
SwitchCase: 'SwitchCase',
Expand Down Expand Up @@ -210,6 +211,7 @@
ReturnStatement: ['argument'],
SequenceExpression: ['expressions'],
SpreadElement: ['argument'],
StaticBlock: ['body'],
Super: [],
SwitchStatement: ['discriminant', 'cases'],
SwitchCase: ['test', 'consequent'],
Expand Down Expand Up @@ -394,7 +396,7 @@
function isProperty(nodeType, key) {
return (nodeType === Syntax.ObjectExpression || nodeType === Syntax.ObjectPattern) && 'properties' === key;
}

function candidateExistsInLeaveList(leavelist, candidate) {
for (var i = leavelist.length - 1; i >= 0; --i) {
if (leavelist[i].node === candidate) {
Expand Down

0 comments on commit d7f27b4

Please sign in to comment.