We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a1d5f7e commit fd94818Copy full SHA for fd94818
.changeset/gold-candles-sing.md
@@ -0,0 +1,5 @@
1
+---
2
+"wmr": patch
3
4
+
5
+Avoid isIdentifier() crash on null/undefined values
packages/wmr/src/lib/acorn-traverse.js
@@ -862,7 +862,7 @@ const TYPES = {
862
/** @type {(a:Node,b?:Node)=>boolean} */
863
isIdentifier(a, b) {
864
if (a instanceof Path) a = a.node;
865
- if (a.type !== 'Identifier') return false;
+ if (!a || a.type !== 'Identifier') return false;
866
return !b || TYPES.isNodesEquivalent(a, b);
867
},
868
react: {
0 commit comments