mirror of
https://github.com/svg/svgo.git
synced 2025-07-29 20:21:14 +03:00
Pass parent node to visitor (#1517)
Wrapping each node with JSAPI class and passing parent to it is not reliable. Parent may be changed but the reference will stay. Here I wasn't able to detach comment from parent node for some reason. Explicit parent node inferred while ast traverse is easier to debug and work with. Eventually we will not need to wrap each node with JSAPI class.
This commit is contained in:
@ -88,7 +88,7 @@ exports.fn = (root, params) => {
|
||||
floatPrecision,
|
||||
noSpaceAfterFlags,
|
||||
});
|
||||
detachNodeFromParent(child);
|
||||
detachNodeFromParent(child, node);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user