mirror of
https://github.com/swc-project/swc.git
synced 2024-12-24 22:22:34 +03:00
a5f7b6946f
**Description:** While investigating, I found that problem is not the analysis of recursive functions. Instead, it was a problem with the IIFE evaluator, which replaces parameters even if it's recursive. **Related issue:** - Closes https://github.com/swc-project/swc/issues/5846
32 lines
682 B
JavaScript
32 lines
682 B
JavaScript
function e(o, l, n, t) {
|
|
const s = o ? o[mergeChildrenPropName] : dataNodes;
|
|
const c = o ? getPosition(n.pos, l) : '0';
|
|
const a = o ? [
|
|
...t,
|
|
o
|
|
] : [];
|
|
if (o) {
|
|
const i = syntheticGetKey(o, c);
|
|
const d = {
|
|
node: o,
|
|
index: l,
|
|
pos: c,
|
|
key: i,
|
|
parentPos: n.node ? n.pos : null,
|
|
level: n.level + 1,
|
|
nodes: a
|
|
};
|
|
callback(d);
|
|
}
|
|
if (s) {
|
|
s.forEach((l, t)=>{
|
|
e(l, t, {
|
|
node: o,
|
|
pos: c,
|
|
level: n ? n.level + 1 : -1
|
|
}, a);
|
|
});
|
|
}
|
|
}
|
|
e(null);
|